91豆麻精品91久久久久久,中文在线资源,国产精品女视频,yw.139尤物在线精品视频

?
  歡迎訪問全國企業(yè)網(wǎng)站設(shè)計NO.1網(wǎng)站開發(fā)商平臺 付款方式
主頁 > 網(wǎng)站建設(shè) > 建站知識 > dedecms織夢遠程圖片本地化https鏈接圖片無法本地

dedecms織夢遠程圖片本地化https鏈接圖片無法本地

POST TIME:2020-10-09

最近有朋友遇到發(fā)布文章時候文章里面帶https的站外圖片無法本地化,以下是解決辦法:
找到  dede//inc/inc_archives_functions.php文件里面GetCurContent($body)這個函數(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);


第二步:
if(!preg_match("#^http://#i", $value))

{

continue;

}

這一段改為:
查看源碼
 
打印代碼幫助
 

if(!preg_match("#^http://#i", $value)&&!preg_match("#^https://#i", $value))

{

continue;

}

搞定,這樣發(fā)文章就可以把https的遠程圖片也本地化了
? 主站蜘蛛池模板: 佛坪县| 襄城县| 黑龙江省| 杨浦区| 平昌县| 扶沟县| 盱眙县| 开阳县| 镇巴县| 南充市| 福泉市| 黎平县| 孝感市| 中山市| 衡南县| 枞阳县| 曲麻莱县| 张家口市| 那曲县| 新郑市| 诸城市| 万全县| 孝昌县| 获嘉县| 南宁市| 若羌县| 呼玛县| 台南县| 阜康市| 托克托县| 缙云县| 宁陵县| 金昌市| 华宁县| 隆化县| 衢州市| 大埔县| 太湖县| 澎湖县| 左贡县| 甘孜|