一直以来我们都是以为HTTPS网站安全性增强了,无法采集复制图片本地化,通过技术上研究发现,通过修改织梦后台系统文件可以解决图片无法远程本地化。
今天我们详解dedecms织梦远程图片本地化https链接图片无法本地化,现在分享给大家,也给大家做个参考。
实现步骤:
找到 dede//inc/inc_archives_functions.php文件里面GetCurContent($body)这个函数,里面
找到代码:
1 preg_match_all( "/src=[" |'|s]{0,}(http://([^>]*).(gif|jpg|png))/isU",$body,$img_array); 2 3 $img_array = array_unique($img_array[1]); |
改为:
1 preg_match_all( "/src=[" |'|s]{0,}(http://([^>]*).(gif|jpg|png))/isU",$body,$img_array); 2 3 preg_match_all( "/src=[" |'|s]{0,}(https://([^>]*).(gif|jpg|png))/isU",$body,$img_array_https); 4 5 $img_array = array_unique($img_array[1]); 6 7 $img_array_https = array_unique($img_array_https[1]); 8 9 $img_array=array_merge_recursive($img_array,$img_array_https); |
第二步 继续查找:
1if(!preg_match("#^http://#i", $value))2 3{4 5continue;6 7} |
改为:
查看源码 打印代码帮助1if(!preg_match("#^http://#i", $value)&&!preg_match("#^https://#i", $value))2 3{4 5continue;6 7} |
教程结束,搞定啦,赶快去试试把,这样发文章就可以把https的远程图片也本地化了。
哈哈哈哈哈
可以的
网站挺不错的!
超喜欢这里的
啦啦啦啦
点赞是不可能点赞的
过来逛逛
主题不错!