Copyright @ 2015-2024 织梦园 版权所有 Power by DedeCms
鲁ICP备15039853号-2

模板标签 TAG标签 网站地图 XML地图 今日更新 返回顶部
对于http的远程图片本地化,dedecms能很好解决,但是碰到https的就无法本地化了,以下是解决办法:
找到 dede//inc/inc_archives_functions.php文件里面GetCurContent($body)这个函数,里面
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)) { continue; } |
if(!preg_match(“#^http:\/\/#i”, $value)&&!preg_match(“#^https:\/\/#i”, $value)) { continue; } |