前面的register_globals v1.5的版本還是有蟲,所以要更改includes/functions/session.php及admin/includes/functions/session.php這兩個檔。
這個函式有問題,要改成下面這個:
function link_session_variable($var_name, $map)
{
if ($map)
{
// Map global to session variable. If the global variable is already set to some value
// then its value overwrites the session variable. I **THINK** this is correct behaviour
if (array_key_exists($var_name,$GLOBALS)) {
$_SESSION[$var_name] =& $GLOBALS[$var_name];
} else {
$GLOBALS[$var_name] =& $_SESSION[$var_name];
}
}
else
{
// Unmap global from session variable. Note that the global variable keeps the value of
// the session variable. This should be unnecessary but it reflects the same behaviour
// as having register_globals enabled, so in case the OSC code assumes this behaviour,
// it is reproduced here
$nothing = 0;
$GLOBALS[$var_name] =& $nothing;
unset($GLOBALS[$var_name]);
$GLOBALS[$var_name] = $_SESSION[$var_name];
}
}
這個函式也有問題,要改成下面這個:
function tep_session_is_registered($variable) {
// >>> BEGIN REGISTER_GLOBALS
// return session_is_registered($variable);
return array_key_exists($variable,$_SESSION);
// <<< END REGISTER_GLOBALS
}