找回密码
 新建账号

Discuz! remote_service mod_index has a deprecated constructor

[复制链接]
php 发表于 2017/11/10 18:24 | 显示全部楼层 |阅读模式
PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; remote_service has a deprecated constructor in ...\api\remote\index.php on line 111
PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; mod_index has a deprecated constructor in ...\api\remote\mod\mod_index.php on line 14
PHP Notice:  Undefined index: mod in ...\connect.php on line 10
前两个问题是一个原因导致的,就是使用和类名相同的方法作为构造方法,现在官方已经不建议使用,在以后的版本会完全抛弃,解决问题的方法,就是按提示的信息,打开类所在的文件,将和类名相同的方法名改为__construct. 细节问题可以参考PHP手册中的魔术方法一节。
第三个问题,是因为Discuz! connect.php中使用了可能不存在的超全局变量$_GET的索引值。
打开connect.php文件,搜索
  1. if($_GET['mod'] == 'register')
复制代码
修改为
  1. if(filter_has_var(INPUT_GET, 'mod') && $_GET['mod'] == 'register')
复制代码
Discuz!有大量的BUG和代码错误,一旦发现就要纠正,否则很容易被黑客利用。

手机版|轻松E站

GMT+8, 2024/4/26 14:52

快速回复 返回顶部 返回列表