Beispiel #1
0
 /**
  * 执行初始化,只执行一次
  */
 public static function setup()
 {
     static $run = null;
     if (null === $run) {
         $run = true;
         if (!IS_CLI) {
             # 记录一个正真的原始拷贝数据
             HttpIO::$_GET_OLD = $_GET;
             HttpIO::$_POST_OLD = $_POST;
             HttpIO::$_COOKIE_OLD = $_COOKIE;
             HttpIO::$_REQUEST_OLD = $_REQUEST;
             # XSS安全处理
             $_GET = HttpIO::sanitize($_GET);
             $_POST = HttpIO::sanitize($_POST);
             $_COOKIE = HttpIO::sanitize($_COOKIE);
             $_REQUEST = HttpIO::sanitize($_REQUEST);
             # 隐射
             HttpIO::$_GET =& $_GET;
             HttpIO::$_POST =& $_POST;
             HttpIO::$_COOKIE =& $_COOKIE;
             HttpIO::$_REQUEST =& $_REQUEST;
             HttpIO::$uri =& Core::$path_info;
         }
         // 自动支持子域名AJAX请求
         if (HttpIO::IS_AJAX && isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']) {
             HttpIO::auto_add_ajax_control_allow_origin();
         }
     }
 }
Beispiel #2
0
 /**
  * 执行初始化,只执行一次
  */
 public static function setup()
 {
     static $run = null;
     if (null === $run) {
         $run = true;
         if (!IS_CLI) {
             # 记录一个正真的原始拷贝数据
             HttpIO::$_GET_OLD = $_GET;
             HttpIO::$_POST_OLD = $_POST;
             HttpIO::$_COOKIE_OLD = $_COOKIE;
             HttpIO::$_REQUEST_OLD = $_REQUEST;
             # XSS安全处理
             $_GET = HttpIO::sanitize($_GET);
             $_POST = HttpIO::sanitize($_POST);
             $_COOKIE = HttpIO::sanitize($_COOKIE);
             $_REQUEST = HttpIO::sanitize($_REQUEST);
             # 隐射
             HttpIO::$_GET =& $_GET;
             HttpIO::$_POST =& $_POST;
             HttpIO::$_COOKIE =& $_COOKIE;
             HttpIO::$_REQUEST =& $_REQUEST;
             HttpIO::$uri =& Core::$path_info;
             HttpIO::$_INPUT_OLD = file_get_contents('php://input');
             if (HttpIO::$_INPUT_OLD) {
                 HttpIO::$_INPUT = @json_decode(HttpIO::$_INPUT_OLD, true);
             }
             if (!HttpIO::$_INPUT) {
                 HttpIO::$_INPUT = array();
             }
         }
         // 自动支持子域名AJAX请求
         if (HttpIO::IS_AJAX && isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']) {
             HttpIO::auto_add_ajax_control_allow_origin();
         }
     }
 }
Beispiel #3
0
 /**
  * 执行初始化,只执行一次
  */
 public static function setup()
 {
     static $run = null;
     if (null === $run) {
         $run = true;
         if (!IS_CLI) {
             # 记录一个正真的原始拷贝数据
             HttpIO::$_GET_OLD = $_GET;
             HttpIO::$_POST_OLD = $_POST;
             HttpIO::$_COOKIE_OLD = $_COOKIE;
             HttpIO::$_REQUEST_OLD = $_REQUEST;
             # XSS安全处理
             $_GET = HttpIO::htmlspecialchars($_GET);
             $_POST = HttpIO::htmlspecialchars($_POST);
             $_COOKIE = HttpIO::htmlspecialchars($_COOKIE);
             $_REQUEST = HttpIO::htmlspecialchars($_REQUEST);
             # 隐射
             HttpIO::$_GET =& $_GET;
             HttpIO::$_POST =& $_POST;
             HttpIO::$_COOKIE =& $_COOKIE;
             HttpIO::$_REQUEST =& $_REQUEST;
             HttpIO::$uri = Core::$path_info;
         }
     }
 }