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

已认证 已通过实名认证 xiuno
管理员
官方成员
10月前 549

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


转载于奇狐网

最后于 10月前 被xiuno编辑 ,原因:

未登录提示:


关闭
他们喜欢这个资源
  • mmgzs
  • Kabob1401
  • lhqf1234
  • phoenixwxq
  • chensheng666
  • 红叶
  • ycyd
  • 88
  • lskbz
  • genemiaki
  • zouai520
  • C先生
  • Ş৳ʀ҉☀ɨꪜꫀ
最新回复 (4)
  • 已通过实名认证 genemiaki
    黑铁
    2
    金币只能充值获得?
    6月前 回复
  • 已认证 已通过实名认证 xiuno
    管理员
    楼主
    官方成员
    3
    genemiaki 金币只能充值获得?
    分享原创插件模板资源也可获得金币奖励
    6月前 回复
  • 已通过实名认证 liyunkun666
    黑铁
    4
    啥也不说了,感谢xiuno顶尖网的分享!
    5月前 回复
  • 已通过实名认证 rxkj1314
    黑铁
    5
    正需要,支持xiuno顶尖网了!
    5月前 回复
    • Xiuno顶尖网
      6
        登陆 注册
  • Ş৳ʀ҉☀ɨꪜꫀ
    6
     点击可以快捷回复 感谢 支持 不错 无奈 一般 生气 回帖 路过 顶帖
    表情
在线客服

特别说明

QQ客服仅提供有偿服务,如无付费意愿,请勿扰!一般问题请站内发帖咨询!
服务项目:
1,xiuno插件模板定制开发
2,xiuno网站BUG修复
3,xiuno个性化定制
4,xiuno仿站等

客服工作时间:8:00~22:00
在线客服