dever 6 vuotta sitten
vanhempi
commit
60ddb0e567
1 muutettua tiedostoa jossa 9 lisäystä ja 0 poistoa
  1. 9 0
      content/lib/Article.php

+ 9 - 0
content/lib/Article.php

@@ -52,6 +52,15 @@ class Article
         if (strstr($data['content'], 'data-file')) {
             # 音频
             preg_match_all('/<img src="(.*?)" style="(.*?)" data-file="(.*?)" \/>/', $data['content'], $matches);
+
+            if (!isset($matches[1][0])) {
+                preg_match_all('/<img style="(.*?)" src="(.*?)" data-file="(.*?)" \/>/', $data['content'], $matches);
+                $temp = array();
+                if (isset($matches[2][0])) {
+                    $temp = $matches;
+                    $matches[1] = $temp[2];
+                    unset($temp);
+            }
             if (isset($matches[1])) {
                 foreach ($matches[1] as $k => $v) {
                     if (isset($matches[3][$k])) {