对于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工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!