From: Roland Häder Date: Tue, 2 Mar 2010 15:24:06 +0000 (+0000) Subject: session_(un)register are deprecated as of 5.3.1 X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e995a896255f853ea731a602a6f4902878f16980;p=mailer.git session_(un)register are deprecated as of 5.3.1 --- diff --git a/inc/libs/security_functions.php b/inc/libs/security_functions.php index da415b965f..7309965b5b 100644 --- a/inc/libs/security_functions.php +++ b/inc/libs/security_functions.php @@ -41,7 +41,7 @@ if (defined('__SECURITY')) return; // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (strpos($_SERVER['PHP_SELF'], basename(__FILE__)) !== false) { die(); } // END - if diff --git a/inc/session-functions.php b/inc/session-functions.php index 8f1669f5a3..735f634194 100644 --- a/inc/session-functions.php +++ b/inc/session-functions.php @@ -55,12 +55,24 @@ function setSession ($var, $value) { // Remove the session //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'UNSET:' . $var . '=' . getSession($var)); unset($GLOBALS['_SESSION'][$var]); - return session_unregister($var); + if (phpversion() >= '5.3.1') { + // session_unregister() is deprecated as of 5.3.1 + return true; + } else { + // PHP version < 5.3.1 + return session_unregister($var); + } } elseif (('' . $value . '' != '') && (!isSessionVariableSet($var))) { // Set session //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'SET:' . $var . '=' . $value); $GLOBALS['_SESSION'][$var] = $value; - return session_register($var); + if (phpversion() >= '5.3.1') { + // session_unregister() is deprecated as of 5.3.1 + return true; + } else { + // PHP version < 5.3.1 + return session_register($var); + } } elseif (!empty($value)) { // Update session //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'UPDATE:' . $var . '=' . $value);