对于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; }
搞定,这样发文章就可以快乐的把https的远程图片也本地化了。
上面是“织梦CMS远程图片遇到https无法本地化的解决办法”的全面内容,想了解更多关于 织梦cms 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_324.html
workflows工作流
一杯咖啡蒸汽形成云ComfyUI工作流
一个女孩骑着一辆生锈的现代摩托车
一只可爱的小鸟在飞翔ComfyUI工作流
图生图局部重绘ComfyUI工作流
懂王特朗普3d漫画ComfyUI工作流
未来椅子3D产品ComfyUI工作流
坐落在白雪覆盖的广阔平原上2只可爱的雪豹
一只蓬松柔软的圆形半鳄梨玩偶
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

css3搭积木叠加图形
css3实现星球旋转
数字滚动效果(兼容IE6/IE8)
利用CSS3做一个星级评分样式
利用CSS3代码编写45款按钮效果
纯css3绘制的小鸟
css3+js菜单点击动态效果
canvas空间文本射线










