织梦cms

推荐列表 站点导航

当前位置:首页 > 建站教程 > 织梦cms >

织梦DEDECMS远程图片遇到https无法本地化的解决办法

来源:网络整理  作者:  发布时间:2020-12-16 09:30
对于http的远程图片本地化,dedecms能很好解决,但是碰到https的就无法本地化了,以下是解决办法: 找到 dede//inc/inc...


这一段改为:


 

if(!preg_match(“#^http:\/\/#i”, $value)&&!preg_match(“#^https:\/\/#i”, $value)) { continue; }  

对于http的远程图片本地化,dedecms能很好解决,但是碰到https的就无法本地化了,以下是解决办法:

 

第二步:
搞定,这样发文章就可以快乐的把https的远程图片也本地化了。
这一段改为:
 

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);  
preg_match_all(“/src=[\”|’|\s]{0,}(http:\/\/([^>]*)\.(gif|jpg|png|jpeg|bmp))/isU”,$body,$img_array); $img_array = array_unique($img_array[1]);  
 


if(!preg_match(“#^http:\/\/#i”, $value)) { continue; }  
 

找到 dede//inc/inc_archives_functions.php文件里面GetCurContent($body)这个函数,里面
 


本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://v30.fanwenzhu.com/jz/dedecms/4394.shtml

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

织梦DEDECMS远程图片遇到https无法本地化的解决办法

2020-12-16 编辑:


这一段改为:


 

if(!preg_match(“#^http:\/\/#i”, $value)&&!preg_match(“#^https:\/\/#i”, $value)) { continue; }  

对于http的远程图片本地化,dedecms能很好解决,但是碰到https的就无法本地化了,以下是解决办法:

 

第二步:
搞定,这样发文章就可以快乐的把https的远程图片也本地化了。
这一段改为:
 

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);  
preg_match_all(“/src=[\”|’|\s]{0,}(http:\/\/([^>]*)\.(gif|jpg|png|jpeg|bmp))/isU”,$body,$img_array); $img_array = array_unique($img_array[1]);  
 


if(!preg_match(“#^http:\/\/#i”, $value)) { continue; }  
 

找到 dede//inc/inc_archives_functions.php文件里面GetCurContent($body)这个函数,里面
 


本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://v30.fanwenzhu.com/jz/dedecms/4394.shtml

相关文章

风云图片

推荐阅读

返回织梦cms频道首页