果玩软件园:为用户提供海量热门软件、游戏等手机资源下载服务!

装机必备热门标签玩游戏装软件BT游戏H5游戏看教程专题游戏盒子手机版

果玩软件园

所在位置:首页 > 资讯教程 > 软件教程 >  > 详情

phpcms v9 不能加https友情链接的完美解决方法

文章来源:网络作者:凛时年发布时间:2026-05-30 06:29:04

GM盒子
GM盒子(高返利版)
GM手游福利平台,免费送首充,上线送VIP,免费领元宝和代金券。
Ready现在很多站都用上了https加密链接,但是一些使用phpcms v9的朋友发现不能加带https的友情链接,添加时会提示不合法,这是由于php中判断没有加入https导致的,下面小编分享完美解决方法,改几个php文件就可以了。



1、打开 \phpcms\modules\link\index.php 文件,找到
 
if($_POST['url']=="" || !preg_match('/^http:\/\/(.*)/i', $_POST['url'])){
showmessage(L('siteurl_not_empty'),"?m=link&c=index&a=register&siteid=$siteid");
 }
 
修改为:
 
if($_POST['url']=="" || !preg_match('/^(http:\/\/|https:\/\/)(.*)/i', $_POST['url'])){
showmessage(L('siteurl_not_empty'),"?m=link&c=index&a=register&siteid=$siteid");
 }
 
找到
 
$logo = safe_replace(strip_tags($_POST['logo']));
if(!preg_match('/^http:\/\/(.*)/i', $logo)){
$logo = '';
}
 
修改为:
 
 $logo = safe_replace(strip_tags($_POST['logo']));
if(!preg_match('/^(http:\/\/|https:\/\/)(.*)/i', $logo)){
$logo = '';
}
 
2、打开 \phpcms\modules\link\templates\link_add.tpl.php 文件,找到
 
$("#link_url").formValidator({onshow:"",onfocus:""}).inputValidator({min:1,onerror:""}).regexValidator({regexp:"^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&]*([^<>])*$",onerror:""})
 
修改为:
 
$("#link_url").formValidator({onshow:"",onfocus:""}).inputValidator({min:1,onerror:""}).regexValidator({regexp:"^(http:\/\/|https:\/\/)[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&]*([^<>])*$",onerror:""})
3、打开 \phpcms\modules\link\templates\link_edit.tpl.php 文件,和上面\link_add.tpl.php的方法一样修改就可以了。


之后大家可以在后台更新一下缓存就可以添加https的网站友情链接了End
复制本文链接资讯文章为果玩软件园所有,未经允许不得转载。
热门游戏MORE+
    相关资讯MORE+
      最新录入
      热门资讯
        新游新品榜
        手机游戏
        手机软件
        手游下载
        装机软件
        精选专题
        游戏排行榜