0 3 0

Xiuno BBS4.0.4不支持php7.4及以上方法

学院助手
23-06-03 1590

解决xiuno4.0.4不支持php7.4及以上

1、/xiunophp/xiunophp.min.php 第20行

$get_magic_quotes_gpc = get_magic_quotes_gpc();

 

改成

$get_magic_quotes_gpc = 0;

 

2、/xiunophp/xiunophp.php 第20行

$get_magic_quotes_gpc = get_magic_quotes_gpc();

 

改成

$get_magic_quotes_gpc = 0;

 

3、/xiunophp/xn_html_safe.func.php 第785行、第938行、第951行

把这三行的

rawtext{}

 

大括号{}改为中括号[],PHP高版本数组不再支持大括号{}。
实测PHP7.4和PHP8.0可以正常使用。

解决php8.1下http_url_path报错方法:

xiunophp/misc.func.php文件大约1034行

源代码:

// 获取 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/";
}

 

来源:http://xiuno.vip/thread-292.htm

展开全文

请先登录后发表评论!

最新回复 (0)

    暂无评论

返回
QR Code
学院交流群
294962666
请先登录后发表评论!