Example #1
0
function server_var($key, $sanitize = true)
{
    $val = NULL;
    if (isset($_SERVER[$key])) {
        $val = $_SERVER[$key];
    } elseif (isset($_ENV[$key])) {
        $val = $_ENV[$key];
    } elseif ($env_val = getenv($key)) {
        $val = $env_val;
    }
    if (!is_null($val)) {
        return $sanitize ? str_xss_sanitize($val) : $val;
    }
}
Example #2
0
function _default_request_path($get)
{
    $path = isset($get[PATH_IN_QUERY_HACK]) ? $get[PATH_IN_QUERY_HACK] : '/';
    return str_xss_sanitize($path);
    //TODO: if $_GET is sanitized we cud remove this!
}