对于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的远程图片也本地化了。
能沟通下不,我弄了还是实现不了。qq:526889758
第二步没找到代码
仔细找找,别用搜索。
找到了,但是发布文章一片空白 ,能否留下qq号
肯定哪里改错,你看看error日志。
还是不行,修改后发布文章一片空白
需要改一个参数的,具体的是文章内带http://的内容的 转换