我的網站模組已經更新到最新版本
這一兩天修改時看到了很多頁面出現了
Undefined index: _gid in /var/local/lib/xoops/lib/modules/protector/class/protector.php on line 764
我以
Undefined index當關鍵字在本站https://www.tad0616.net右下角使用google search看看是否有人貼過這類的文章,但出現以下訊息我只好進討論區貼文了。想請問這樣的訊息該怎麼調整網站?
我查了764行是 if ($_REQUEST[$key] == $_COOKIE[$key]) {
那一行附近的完整段落如下
public function intval_allrequestsendid()
{
global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS;
if ($this->_done_intval) {
return true;
} else {
$this->_done_intval = true;
}
foreach ($_GET as $key => $val) {
if (substr($key, -2) === 'id' && !is_array($_GET[$key])) {
$newval = preg_replace('/[^0-9a-zA-Z_-]/', '', $val);
$_GET[$key] = $HTTP_GET_VARS[$key] = $newval;
if ($_REQUEST[$key] == $_GET[$key]) {
$_REQUEST[$key] = $newval;
}
}
}
foreach ($_POST as $key => $val) {
if (substr($key, -2) === 'id' && !is_array($_POST[$key])) {
$newval = preg_replace('/[^0-9a-zA-Z_-]/', '', $val);
$_POST[$key] = $HTTP_POST_VARS[$key] = $newval;
if ($_REQUEST[$key] == $_POST[$key]) {
$_REQUEST[$key] = $newval;
}
}
}
foreach ($_COOKIE as $key => $val) {
if (substr($key, -2) === 'id' && !is_array($_COOKIE[$key])) {
$newval = preg_replace('/[^0-9a-zA-Z_-]/', '', $val);
$_COOKIE[$key] = $HTTP_COOKIE_VARS[$key] = $newval;
if ($_REQUEST[$key] == $_COOKIE[$key]) {
$_REQUEST[$key] = $newval;
}
}
}
return true;