소스 검색

Correct login issues with PHP < 4.1
Correctly retrieve values from global vars in case where
4.1 superglobals are not defined..
(Problem caused by references made in global scope not existing within
function scope).

Erin Schnabel 22 년 전
부모
커밋
1d129bc9fa
1개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  1. 9 1
      functions/global.php

+ 9 - 1
functions/global.php

@@ -188,8 +188,16 @@ define('SQ_SERVER',5);
  * Returns TRUE if it is.
  */
 function sqgetGlobalVar($name, &$value, $search = SQ_INORDER) {
+
     if ( !check_php_version(4,1) ) {
-        global $_SESSION, $_GET, $_POST, $_COOKIE, $_SERVER;
+        global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $HTTP_POST_VARS, 
+               $HTTP_SERVER_VARS, $HTTP_SESSION_VARS;
+
+        $_COOKIE  =& $HTTP_COOKIE_VARS;
+        $_GET     =& $HTTP_GET_VARS;
+        $_POST    =& $HTTP_POST_VARS;
+        $_SERVER  =& $HTTP_SERVER_VARS;
+        $_SESSION =& $HTTP_SESSION_VARS;
     }
 
     /* NOTE: DO NOT enclose the constants in the switch