Пример #1
0
 function getpost_single($vname)
 {
     return sanitize_data($this->_dirty_vars[$vname]);
 }
Пример #2
0
function getpost_ifset($test_vars)
{
    if (!is_array($test_vars)) {
        $test_vars = array($test_vars);
    }
    foreach ($test_vars as $test_var) {
        if (isset($_POST[$test_var])) {
            global ${$test_var};
            ${$test_var} = $_POST[$test_var];
        } elseif (isset($_GET[$test_var])) {
            global ${$test_var};
            ${$test_var} = $_GET[$test_var];
        }
        if (isset(${$test_var})) {
            ${$test_var} = sanitize_data(${$test_var});
            //rebuild the search parameter to filter character to format card number
            if ($test_var == 'username' || $test_var == 'filterprefix') {
                //rebuild the search parameter to filter character to format card number
                $filtered_char = array(" ", "-", "_", "(", ")", "/", "\\");
                ${$test_var} = str_replace($filtered_char, "", ${$test_var});
            }
        }
    }
}
Пример #3
0
$translations_url = curlEnabled() ? $protocol . $_SERVER[HTTP_HOST] . str_replace('process.php', 'translations.json', $_SERVER["REQUEST_URI"]) : 'translations.json';
$translations = curlEnabled() ? curl_file_get_contents($translations_url) : file_get_contents($translations_url);
$translations = json_decode($translations);
$lang = $translations->default_lang;
// check if data has actually been sent to the form
checkIfDataHasBeenSent();
// set up timezone and PHP "end of line";
$timezone = ini_get('date.timezone');
if (empty($timezone)) {
    date_default_timezone_set('Europe/London');
}
if (!defined("PHP_EOL")) {
    define("PHP_EOL", "\r\n");
}
// grab data from form
$fdata = sanitize_data($_POST);
$files = isset($_FILES['attachment']) ? $_FILES['attachment'] : null;
/**
 * VALIDATE FORM FIELD DATA
 * ==================================================================
 *
 * Add any custom validation you want for your form below.
 * Simply add a new "case" for each field in your form(s) for them
 * to be checked and validated against.
 *
 * e.g.
 * case 'field_name':
 *     if(empty($value)){ array_push($errors, 'Your message'); }
 *     break;
 *
 */
Пример #4
0
/** Return a single variable from the post/get data */
function getpost_single($vname)
{
    if (isset($_POST[$vname])) {
        return sanitize_data($_POST[$vname]);
    } elseif (isset($_GET[$vname])) {
        return sanitize_data($_GET[$vname]);
    } else {
        return null;
    }
}
Пример #5
0
 function &getProcessed()
 {
     foreach ($this->_vars as $key => $value) {
         if (!$this->_processed[$key] or empty($this->_processed[$key])) {
             $this->_processed[$key] = sanitize_data($value);
             if ($key == 'username') {
                 //rebuild the search parameter to filter character to format card number
                 $filtered_char = array(" ", "-", "_", "(", ")", "+");
                 $this->_processed[$key] = str_replace($filtered_char, "", $this->_processed[$key]);
             }
             if ($key == 'pwd_encoded') {
                 $this->_processed[$key] = hash('whirlpool', $this->_processed[$key]);
             }
         }
     }
     return $this->_processed;
 }