dever 6 năm trước cách đây
mục cha
commit
d3f187d81e
1 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 4 4
      content/lib/Article.php

+ 4 - 4
content/lib/Article.php

@@ -49,13 +49,13 @@ class Article
 
         if (strstr($data['content'], 'data-id')) {
             # 视频
-            preg_match_all('/<p>(\s[^>]*)<img(.*?)data-id="(.*?)" data-key="(.*?)" \/>(\s[^>]*)<\/p>/is', $data['content'], $matches);
+            preg_match_all('/<p(.*?)>(\s[^>]*)<img(.*?)data-id="(.*?)" data-key="(.*?)" \/>(\s[^>]*)<\/p>/is', $data['content'], $matches);
             $replace = array();
             $content = $data['content'];
-            if (isset($matches[3][0]) && isset($matches[4][0])) {
-                foreach ($matches[3] as $k => $v) {
+            if (isset($matches[4][0]) && isset($matches[5][0])) {
+                foreach ($matches[4] as $k => $v) {
                     $content = str_replace($matches[0][$k], '{replace}'.$k.'{replace}', $content);
-                    if ($matches[4][$k] == 'video/lib/core.vod') {
+                    if ($matches[5][$k] == 'video/lib/core.vod') {
                         $method = 'video/lib/vod';
                         $type = 2;
                     } else {