Error[8]: Undefined index: tids, File: D:\phpstudy_pro\WWW\xxx.com\tmp\route_index.php, Line: 76
File: D:\phpstudy_pro\WWW\xxx.com\tmp\index.inc.php, Line: 95, include(D:\phpstudy_pro\WWW\xxx.com\tmp\route_index.php)
File: D:\phpstudy_pro\WWW\xxx.com\index.php, Line: 29, include(D:\phpstudy_pro\WWW\xxx.com\tmp\index.inc.php)
查看route/index.php 第73-75行
if (!empty($flaglist)) {
foreach ($flaglist as $key => $val) {
if (in_array($_thread['tid'], $val['tids'])) { // 报错
$flaglist[$key]['list'][array_search($_thread['tid'], $val['tids'])] = $_thread;
ksort($flaglist[$key]['list']);
// hook index_custom_flag.php
}
}
}
改为
if (!empty($flaglist)) {
foreach ($flaglist as $key => $val) {
if (!empty($val['tids']) && in_array($_thread['tid'], $val['tids'])) { // 增加判断变量是否为空
$flaglist[$key]['list'][array_search($_thread['tid'], $val['tids'])] = $_thread;
ksort($flaglist[$key]['list']);
// hook index_custom_flag.php
}
}
}