dever 6 年之前
父节点
当前提交
6826a091f2
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      content/lib/Article.php

+ 5 - 1
content/lib/Article.php

@@ -23,7 +23,7 @@ class Article
         if (strstr($data['content'], 'font-family:" hiragino="" sans="" gb","microsoft="" yahei","simsun";')) {
             $data['content'] = str_replace('font-family:" hiragino="" sans="" gb","microsoft="" yahei","simsun";', '', $data['content']);
         }
-        
+
         if (strstr($data['content'], 'font-family:" gb","microsoft="" sans="" hiragino="" yahei","simsun";')) {
             $data['content'] = str_replace('font-family:" gb","microsoft="" sans="" hiragino="" yahei","simsun";', '', $data['content']);
         }
@@ -64,6 +64,10 @@ class Article
             preg_match_all('/<p(.*?)>([\s]+)<img(.*?)data-id="(.*?)" data-key="(.*?)" \/>([\s]+)<\/p>/', $data['content'], $matches);
             
             
+            if (!isset($matches[4][0])) {
+                preg_match_all('/<p(.*?)>([\s]+)<img(.*?)data-key="(.*?)" data-id="(.*?)" \/>([\s]+)<\/p>/', $data['content'], $matches);
+            }
+            
             if (isset($matches[4][0]) && isset($matches[5][0])) {
                 foreach ($matches[4] as $k => $v) {
                     $content = str_replace($matches[0][$k], '{replace}'.count($replace).'{replace}', $content);