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
// 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);