|
@@ -40,28 +40,6 @@ $uid_support = true;
|
|
|
|
|
|
sqsession_is_active();
|
|
sqsession_is_active();
|
|
|
|
|
|
-/* convert old-style superglobals to current method
|
|
|
|
- * this is executed if you are running PHP 4.0.x.
|
|
|
|
- * it is run via a require_once directive in validate.php
|
|
|
|
- * and redirect.php. Patch submitted by Ray Black.
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
-if ( !check_php_version(4,1) ) {
|
|
|
|
- global $_COOKIE, $_ENV, $_FILES, $_GET, $_POST, $_SERVER, $_SESSION;
|
|
|
|
- global $HTTP_COOKIE_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES, $HTTP_GET_VARS,
|
|
|
|
- $HTTP_POST_VARS, $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $PHP_SELF;
|
|
|
|
- $_COOKIE =& $HTTP_COOKIE_VARS;
|
|
|
|
- $_ENV =& $HTTP_ENV_VARS;
|
|
|
|
- $_FILES =& $HTTP_POST_FILES;
|
|
|
|
- $_GET =& $HTTP_GET_VARS;
|
|
|
|
- $_POST =& $HTTP_POST_VARS;
|
|
|
|
- $_SERVER =& $HTTP_SERVER_VARS;
|
|
|
|
- $_SESSION =& $HTTP_SESSION_VARS;
|
|
|
|
- if (!isset($PHP_SELF) || empty($PHP_SELF)) {
|
|
|
|
- $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/* if running with magic_quotes_gpc then strip the slashes
|
|
/* if running with magic_quotes_gpc then strip the slashes
|
|
from POST and GET global arrays */
|
|
from POST and GET global arrays */
|
|
|
|
|
|
@@ -148,13 +126,8 @@ function sqsession_register ($var, $name) {
|
|
|
|
|
|
sqsession_is_active();
|
|
sqsession_is_active();
|
|
|
|
|
|
- if ( !check_php_version(4,1) ) {
|
|
|
|
- global $HTTP_SESSION_VARS;
|
|
|
|
- $HTTP_SESSION_VARS[$name] = $var;
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- $_SESSION["$name"] = $var;
|
|
|
|
- }
|
|
|
|
|
|
+ $_SESSION["$name"] = $var;
|
|
|
|
+
|
|
session_register("$name");
|
|
session_register("$name");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -167,13 +140,8 @@ function sqsession_unregister ($name) {
|
|
|
|
|
|
sqsession_is_active();
|
|
sqsession_is_active();
|
|
|
|
|
|
- if ( !check_php_version(4,1) ) {
|
|
|
|
- global $HTTP_SESSION_VARS;
|
|
|
|
- unset($HTTP_SESSION_VARS[$name]);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- unset($_SESSION[$name]);
|
|
|
|
- }
|
|
|
|
|
|
+ unset($_SESSION[$name]);
|
|
|
|
+
|
|
session_unregister("$name");
|
|
session_unregister("$name");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -186,17 +154,11 @@ function sqsession_unregister ($name) {
|
|
function sqsession_is_registered ($name) {
|
|
function sqsession_is_registered ($name) {
|
|
$test_name = &$name;
|
|
$test_name = &$name;
|
|
$result = false;
|
|
$result = false;
|
|
- if ( !check_php_version(4,1) ) {
|
|
|
|
- global $HTTP_SESSION_VARS;
|
|
|
|
- if (isset($HTTP_SESSION_VARS[$test_name])) {
|
|
|
|
- $result = true;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- if (isset($_SESSION[$test_name])) {
|
|
|
|
- $result = true;
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ if (isset($_SESSION[$test_name])) {
|
|
|
|
+ $result = true;
|
|
}
|
|
}
|
|
|
|
+
|
|
return $result;
|
|
return $result;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -232,17 +194,6 @@ define('SQ_FORM',6);
|
|
*/
|
|
*/
|
|
function sqgetGlobalVar($name, &$value, $search = SQ_INORDER) {
|
|
function sqgetGlobalVar($name, &$value, $search = SQ_INORDER) {
|
|
|
|
|
|
- if ( !check_php_version(4,1) ) {
|
|
|
|
- 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
|
|
/* NOTE: DO NOT enclose the constants in the switch
|
|
statement with quotes. They are constant values,
|
|
statement with quotes. They are constant values,
|
|
enclosing them in quotes will cause them to evaluate
|
|
enclosing them in quotes will cause them to evaluate
|
|
@@ -316,12 +267,7 @@ function sqsession_destroy() {
|
|
|
|
|
|
$sessid = session_id();
|
|
$sessid = session_id();
|
|
if (!empty( $sessid )) {
|
|
if (!empty( $sessid )) {
|
|
- if ( !check_php_version(4,1) ) {
|
|
|
|
- global $HTTP_SESSION_VARS;
|
|
|
|
- $HTTP_SESSION_VARS = array();
|
|
|
|
- } else {
|
|
|
|
- $_SESSION = array();
|
|
|
|
- }
|
|
|
|
|
|
+ $_SESSION = array();
|
|
@session_destroy();
|
|
@session_destroy();
|
|
}
|
|
}
|
|
|
|
|