發(fā)表日期:2018-08 文章編輯:小燈 瀏覽次數(shù):3359
本文為大家介紹一下DEDECMS遠(yuǎn)程圖片遇到Https無(wú)法本地化解決辦法,由于現(xiàn)在許多網(wǎng)站使用了HTTPS技術(shù),所以我們?cè)贒EDE后臺(tái)發(fā)布文章時(shí),可能會(huì)遇到對(duì)于https的就無(wú)法本地化的問(wèn)題,關(guān)于http的遠(yuǎn)程圖片本地化,要想支持HTTPS,其實(shí)也非常簡(jiǎn)單,以下是解決辦法:
找到dede//inc/inc_archives_functions.php (注:前邊紅色的dede目錄是您的后臺(tái)目錄)
定位到文件里面GetCurContent($body)這個(gè)函數(shù)
將以下代碼:
preg_match_all("/src=[\"|’|\s]{0,}(http:\/\/([^>]*)\.(gif|jpg|png|jpeg|bmp))/isU",$body,$img_array); $img_array = array_unique($img_array[1]); |
改為:
preg_match_all("/src=[\"|’|\s]{0,}(http:\/\/([^>]*)\.(gif|jpg|png|jpeg|bmp))/isU",$body,$img_array); preg_match_all("/src=[\"|’|\s]{0,}(https:\/\/([^>]*)\.(gif|jpg|png|jpeg|bmp))/isU",$body,$img_array_https); $img_array = array_unique($img_array[1]); $img_array_https = array_unique($img_array_https[1]); $img_array=array_merge_recursive($img_array,$img_array_https); |
再找到:
if(!preg_match("#^http:\/\/#i", $value)) |
改為:
if(!preg_match("#^http:\/\/#i", $value)&&!preg_match("#^https:\/\/#i", $value)) { continue; } |
保存文件并上傳,這樣https的遠(yuǎn)程圖片本地化的問(wèn)題就解決了!
PS:如果您的DEDE版本低于5.7,比如:5.5或5.1,請(qǐng)留言給我,解決方法不太一樣哦。
日期:2018-09 瀏覽次數(shù):3520
日期:2018-09 瀏覽次數(shù):4726
日期:2018-09 瀏覽次數(shù):3290
日期:2018-09 瀏覽次數(shù):3167
日期:2018-09 瀏覽次數(shù):3271
日期:2018-09 瀏覽次數(shù):3089
日期:2018-09 瀏覽次數(shù):3527
日期:2018-09 瀏覽次數(shù):3681
日期:2018-09 瀏覽次數(shù):3373
日期:2018-09 瀏覽次數(shù):3542
日期:2018-09 瀏覽次數(shù):3283
日期:2018-09 瀏覽次數(shù):3319
日期:2018-09 瀏覽次數(shù):3167
日期:2018-09 瀏覽次數(shù):3066
日期:2018-09 瀏覽次數(shù):3277
日期:2018-09 瀏覽次數(shù):3182
日期:2018-09 瀏覽次數(shù):4170
日期:2018-09 瀏覽次數(shù):3137
日期:2018-09 瀏覽次數(shù):3358
日期:2018-09 瀏覽次數(shù):3325
日期:2018-08 瀏覽次數(shù):3327
日期:2018-08 瀏覽次數(shù):3359
日期:2018-08 瀏覽次數(shù):3086
日期:2018-08 瀏覽次數(shù):3960
日期:2018-08 瀏覽次數(shù):3599
日期:2018-08 瀏覽次數(shù):3265
日期:2018-08 瀏覽次數(shù):4953
日期:2018-08 瀏覽次數(shù):3414
日期:2018-08 瀏覽次數(shù):3399
日期:2018-08 瀏覽次數(shù):3980
Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.