隨著網站安全的深入,現在越來越多的網站都開始使用了https,在換友情鏈接的時候要填寫https開頭的網址,可是phpcms v9卻只能填寫以http開頭的網站,該如何修改呢?361模板網經過摸索和在網上找到的一些教程然后做了些變動,下面分享給大家,希望對您有所幫助。
找到
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 = '';}
找到
$("#link_url").formValidator({onshow:"<?php echo L("input").L('url')?>",onfocus:"<?php echo L("input").L('url')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('url')?>"}).regexValidator({regexp:"^http:////[A-Za-z0-9]+/.[A-Za-z0-9]+[//=/?%/-&]*([^<>])*$",onerror:"<?php echo L('link_onerror')?>"})
修改為:
$("#link_url").formValidator({onshow:"<?php echo L("input").L('url')?>",onfocus:"<?php echo L("input").L('url')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('url')?>"}).regexValidator({regexp:"^(http:////|https:////)[A-Za-z0-9]+/.[A-Za-z0-9]+[//=/?%/-&]*([^<>])*$",onerror:"<?php echo L('link_onerror')?>"})
這樣修改處理后就能實現PHPCMS V9添加https開頭的友情鏈接了。
以上就是PHPCMS V9如何添加https開頭的友情鏈接的全部內容,希望對大家的學習和解決疑問有所幫助,也希望大家多多支持武林網。新聞熱點
疑難解答