# 织梦cms复制https链接网站图片无法本地化的解决办法

*Published:* 2023-10-26
*Author:* 客服001

#### 温馨提醒

如果文章内容或图片资源失效，请留言反馈，我们会及时处理，谢谢

本文最后更新于2023年10月26日，已超过 180天没有更新



### 第一步：

找到dede/inc/inc\_archives\_functions.php （注：前边红色的dede目录是您的后台目录）

定位到文件里面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,}(<a class="tag_link" href="https://www.xarjtc.com/tag/https" target="_blank" title="查看https此标签更多文章"><abbr title="">https</abbr></a>:\/\/([^>]*)\.(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的远程[图片](https://www.xarjtc.com/tag/pic "查看图片此标签更多文章")本地化的问题就解决了！