Fang Weihuan Code, get current script is false system error request_tainting problem

Source: Internet
Author: User
$_FANWE['php_self'] = htmlspecialchars(getPhpSelf());if($_FANWE['php_self'] === false)        systemError('request_tainting');

$_fanwe is a global variable, the getphpself () function is the function that gets the current script, the program greatly, what kind of scene will trigger this error, do not understand, implore to indicate

Report:

function getPhpSelf(){    $php_self = '';    $script_name = basename($_SERVER['SCRIPT_FILENAME']);    if(basename($_SERVER['SCRIPT_NAME']) === $script_name)        $php_self = $_SERVER['SCRIPT_NAME'];    else if(basename($_SERVER['PHP_SELF']) === $script_name)        $php_self = $_SERVER['PHP_SELF'];    else if(isset($_SERVER['ORIG_SCRIPT_NAME']) && basename($_SERVER['ORIG_SCRIPT_NAME']) === $script_name)        $php_self = $_SERVER['ORIG_SCRIPT_NAME'];    else if(($pos = strpos($_SERVER['PHP_SELF'],'/'.$script_name)) !== false)        $php_self = substr($_SERVER['SCRIPT_NAME'],0,$pos).'/'.$script_name;    else if(isset($_SERVER['DOCUMENT_ROOT']) && strpos($_SERVER['SCRIPT_FILENAME'],$_SERVER['DOCUMENT_ROOT']) === 0)        $php_self = str_replace('\\','/',str_replace($_SERVER['DOCUMENT_ROOT'],'',$_SERVER['SCRIPT_FILENAME']));    else        return false;    return $php_self;}

Reply content:

$_FANWE['php_self'] = htmlspecialchars(getPhpSelf());if($_FANWE['php_self'] === false)        systemError('request_tainting');

$_fanwe is a global variable, the getphpself () function is the function that gets the current script, the program greatly, what kind of scene will trigger this error, do not understand, implore to indicate

Report:

  function getphpself () {$php _self = ';    $script _name = basename ($_server[' script_filename ');    if (basename ($_server[' script_name ')) = = = $script _name) $php _self = $_server[' Script_name '];    else if (basename ($_server[' php_self ')) = = = $script _name) $php _self = $_server[' php_self ']; else if (isset ($_server[' orig_script_name ')) && basename ($_server[' orig_script_name ']) = = = $script _name) $ph    p_self = $_server[' orig_script_name ']; else if ($pos = Strpos ($_server[' php_self '), '/'. $script _name))!== false) $php _self = substr ($_server[' script_name ') ],0, $pos). '    /'. $script _name; else if (isset ($_server[' document_root ')) && strpos ($_server[' script_filename '],$_server[' document_root '])    = = = 0) $php _self = str_replace (' \ \ ', '/', Str_replace ($_server[' document_root '], ' ', $_server[' Script_filename ')]);    else return false; return $php _self;}  

Should be the time of server configuration exception. There will be that mistake.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.