后台管理设置频繁报错
在包括且不限于以下页面修改内容后保存时,会报下截图错误:1.全局-注册与访问控制
2.全局-SEO设置
3.全局-域名设置
4.全局-空间设置
5.全局-用户权限
6.全局-积分设置
7.全局-上传设置
8.全局-水印设置
9.全局-手机设置
10.全局-防采集设置
11.界面-导航设置
12.界面-界面设置
等...
报错截图如下:
1 贡献最佳答案
给用户栏目设置上资料项,或者打开 source\function\cache\cache_setting.php
找到
foreach($profile_settings as $pval) { if(in_array($pval['fieldid'], $val['field'])) { $temp[$pval['fieldid']] = $pval['fieldid']; } } foreach($val['field'] as $fieldid) { if(!in_array($fieldid, $temp)) { $temp[$fieldid] = $fieldid; } }修改为if (!empty($val['field']) && is_array($val['field'])) { foreach($profile_settings as $pval) { if(in_array($pval['fieldid'], $val['field'])) { $temp[$pval['fieldid']] = $pval['fieldid']; } } foreach($val['field'] as $fieldid) { if(!in_array($fieldid, $temp)) { $temp[$fieldid] = $fieldid; } } }
DZ插件网发表于1 小时前
[*]详细答案 >
用户栏目设置里,未选择任何资料项 你这什么版本的dz呀?
php版本改成php7吧; 别用php8 了 php 8.0.26,这个有讲究吗? dz是3.5的 给用户栏目设置上资料项,或者打开 source\function\cache\cache_setting.php
找到
foreach($profile_settings as $pval) { if(in_array($pval['fieldid'], $val['field'])) { $temp[$pval['fieldid']] = $pval['fieldid']; } } foreach($val['field'] as $fieldid) { if(!in_array($fieldid, $temp)) { $temp[$fieldid] = $fieldid; } }修改为if (!empty($val['field']) && is_array($val['field'])) { foreach($profile_settings as $pval) { if(in_array($pval['fieldid'], $val['field'])) { $temp[$pval['fieldid']] = $pval['fieldid']; } } foreach($val['field'] as $fieldid) { if(!in_array($fieldid, $temp)) { $temp[$fieldid] = $fieldid; } } } 切换php7已解决,感谢大佬! 切换php7已解决,这段代码看上去是加了个控制和非数组的判断,如果不满足条件不执行,那能正确保存吗?虽然那个报错,但是刷新页面后,大部分设置项都有保存成功 没啥问题的;php对代码要求更严格! 等程序修复就可以了 PHP v8.1.18,没看到报错
页:
[1]