Xiuno

让Xiuno BBS 4.0.4支持并兼容php7.3+

在Xiuno原基础上支持php7.3及更高版本

修复一些原官方程序的bug;

比如:

取消置顶时,未删除thread_top表内帖子tid的BUG;

点击置顶、移动、删除等按钮后,没做任何操作,直接关闭了弹窗,右侧滚动栏未恢复的BUG。

后台模版钩子名称错误等等;

......

屏蔽Xiuno官网升级检测;

安装文件增加安装锁,安装后不会重复安装,避免粗心用户未删除安装文件,造成被他人安装远程数据库。

安装时,自动增加一个用户名为系统的用户,密码与管理员用户相同(可后台自行修改新密码),可以用于支持消息插件发送系统消息(此处懂的自然懂)。

基本上保持官方4.0.4原版内容。

实测PHP7.4和PHP8.0可以正常使用。

新发现问题,暂时就不更新了,需要的自行修改。

xiunophp/misc.func.php文件大约1034行的http_url_path方法在php8.1下报错解决方法:

源代码:

// 获取 http://xxx.com/path/function http_url_path() {    $port = _SERVER("SERVER_PORT"); //$portadd = ($port == 80 ? "" : ":".$port);    $host = _SERVER("HTTP_HOST");  // host 里包含 port $https = strtolower(_SERVER("HTTPS", "off"));   $proto = strtolower(_SERVER("HTTP_X_FORWARDED_PROTO")); $path = substr($_SERVER["PHP_SELF"], 0, strrpos($_SERVER["PHP_SELF"], "/"));    $http = (($port == 443) || $proto == "https" || ($https && $https != "off")) ? "https" : "http";    return  "$http://$host$path/";}

更改后:

// 获取 http://xxx.com/path/function http_url_path() {    $port = _SERVER("SERVER_PORT"); //$portadd = ($port == 80 ? "" : ":".$port);    $host = _SERVER("HTTP_HOST");  // host 里包含 port $https = strtolower(_SERVER("HTTPS", "off"));   $proto = _SERVER("HTTP_X_FORWARDED_PROTO") ? strtolower(_SERVER("HTTP_X_FORWARDED_PROTO")) : ""; //此处加判断    $path = substr($_SERVER["PHP_SELF"], 0, strrpos($_SERVER["PHP_SELF"], "/"));    $http = (($port == 443) || $proto == "https" || ($https && $https != "off")) ? "https" : "http";    return  "$http://$host$path/";}

🗨️ 评论区