コード例 #1
0
ファイル: settings.php プロジェクト: istrwei/china-vpn
 //validate form data...
 $meowdata['meow_protect_login'] = intval($_POST['meow_protect_login']) === 1;
 $meowdata['meow_fail_limit'] = (int) $_POST['meow_fail_limit'];
 //silently correct invalid choice
 if ($meowdata['meow_fail_limit'] < 1) {
     $meow['meow_fail_limit'] = 5;
 }
 $meowdata['meow_fail_window'] = 60 * intval($_POST['meow_fail_window']);
 //silently correct invalid choice
 if ($meowdata['meow_fail_window'] < 60) {
     $meow['meow_fail_window'] = 43200;
 } elseif ($meowdata['meow_fail_window'] > 86400) {
     $meow['meow_fail_window'] = 43200;
 }
 $meowdata['meow_fail_reset_on_success'] = intval($_POST['meow_fail_reset_on_success']) === 1;
 $meowdata['meow_ip_exempt'] = meow_sanitize_ips(explode("\n", meow_newlines($_POST['meow_ip_exempt'])));
 $meowdata['meow_apocalypse_title'] = trim(strip_tags($_POST["meow_apocalypse_title"]));
 $meowdata['meow_apocalypse_content'] = trim(strip_tags($_POST['meow_apocalypse_content']));
 $meowdata['meow_clean_database'] = intval($_POST['meow_clean_database']) === 1;
 $meowdata['meow_data_expiration'] = (int) $_POST['meow_data_expiration'];
 //silently correct bad data
 if ($meowdata['meow_data_expiration'] < 10) {
     $meowdata['meow_data_expiration'] = 90;
 }
 $meowdata['meow_store_ua'] = intval($_POST['meow_store_ua']) === 1;
 $meowdata['meow_password_alpha'] = in_array($_POST['meow_password_alpha'], array('optional', 'required', 'required-both')) ? $_POST['meow_password_alpha'] : 'optional';
 $meowdata['meow_password_numeric'] = in_array($_POST['meow_password_numeric'], array('optional', 'required')) ? $_POST['meow_password_numeric'] : 'optional';
 $meowdata['meow_password_symbol'] = in_array($_POST['meow_password_symbol'], array('optional', 'required')) ? $_POST['meow_password_symbol'] : 'optional';
 $meowdata['meow_password_length'] = (double) $_POST['meow_password_length'];
 //silently correct bad data
 if ($meowdata['meow_password_length'] < 1) {
コード例 #2
0
ファイル: index.php プロジェクト: istrwei/china-vpn
function meow_wpcontent_htaccess_exists()
{
    //if the file doesn't exist, return false
    if (!file_exists(MEOW_HTACCESS_FILE)) {
        return false;
    }
    //try to read the file
    if (false === ($htcontent = @file_get_contents(MEOW_HTACCESS_FILE))) {
        return false;
    }
    //finally, are the contents as expected (give or take some new lines)
    return trim(meow_newlines($htcontent)) === MEOW_HTACCESS;
}