Undefined index: mod in function_core.php on line 805 New
Notice: Undefined index: mod in D:\www\source\function\function_core.php on line 805
805行:deepseek 给的修复:我知道答案 回答被采纳将会获得1 贡献 已有0人回答
805行:
- foreach($_G['setting']['navmns'][$_G['basefilename']] as $navmn) { if($navmn[0] == array_intersect_assoc($navmn[0], $_GET) || (isset($_GET['gid']) && $navmn[0]['mod'] == 'forumdisplay' && $navmn[0]['fid'] == $_GET['gid']) || ($navmn[0]['mod'] == 'space' && $_GET['mod'] == 'spacecp' && ($navmn[0]['do'] == $_GET['ac'] || $navmn[0]['do'] == 'album' && $_GET['ac'] == 'upload'))) { $mnid = $navmn[1]; } }
- foreach ($_G['setting']['navmns'][$_G['basefilename']] as $navmn) { // 检查 $navmn 是否为数组且 $navmn[0] 存在 if (!is_array($navmn) || !isset($navmn[0])) { continue; } $navmn0 = $navmn[0]; // 检查 $navmn0 是否为数组且包含关键字段 if (!is_array($navmn0) || !isset($navmn0['mod'])) { continue; } $mod = $navmn0['mod'] ?? ''; // 使用 null 合并运算符提供默认值 $fid = isset($navmn0['fid']) ? $navmn0['fid'] : null; $do = isset($navmn0['do']) ? $navmn0['do'] : null; // 重构条件判断逻辑,逐层检查索引存在性 if ( $navmn0 == array_intersect_assoc($navmn0, $_GET) || ( isset($_GET['gid']) && $mod == 'forumdisplay' && $fid == $_GET['gid'] ) || ( $mod == 'space' && $_GET['mod'] == 'spacecp' && ( $do == $_GET['ac'] || ( $do == 'album' && isset($_GET['ac']) && $_GET['ac'] == 'upload' ) ) ) ) { $mnid = $navmn[1]; }}