dedecms織夢https站點(diǎn)圖片無法遠(yuǎn)程本地化解決辦法!
一直以來我們都是以為HTTPS網(wǎng)站安全性增強(qiáng)了,無法采集復(fù)制圖片本地化,通過技術(shù)上研究發(fā)現(xiàn),通過修改織夢后臺(tái)系統(tǒng)文件可以解決圖片無法遠(yuǎn)程本地化。
今天我們詳解dedecms織夢遠(yuǎn)程圖片本地化https鏈接圖片無法本地化,現(xiàn)在分享給大家,也給大家做個(gè)參考。
實(shí)現(xiàn)步驟:
找到 dede//inc/inc_archives_functions.php文件里面GetCurContent($body)這個(gè)函數(shù),里面
找到代碼:
preg_match_all("/src=["|'|s]{0,}(http://([^>]*).(gif|jpg|png))/isU",$body,$img_array);
$img_array = array_unique($img_array[1]);
改為:
preg_match_all("/src=["|'|s]{0,}(http://([^>]*).(gif|jpg|png))/isU",$body,$img_array);
preg_match_all("/src=["|'|s]{0,}(https://([^>]*).(gif|jpg|png))/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);
第二步 繼續(xù)查找:
if(!preg_match("#^http://#i", $value))
{
continue;
}
改為:
if(!preg_match("#^http://#i", $value)&&!preg_match("#^https://#i", $value))
{
continue;
}
搞定,這樣發(fā)文章就可以把https的遠(yuǎn)程圖片也本地化了
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持小站。
新聞熱點(diǎn)
疑難解答
圖片精選