Ken преди 1 седмица
родител
ревизия
13f49ffe2a
променени са 1 файла, в които са добавени 2 реда и са изтрити 4 реда
  1. 2 4
      app/Services/BaseService.php

+ 2 - 4
app/Services/BaseService.php

@@ -216,12 +216,10 @@ class BaseService
         if (!empty($image)) $len = 1024;
         foreach ($array as $item) {
             if (count($texts) > 1) $len = 4096;
-            if (count($texts) == 0) {
+            if (count($texts) == 0 || strlen($texts[count($texts) - 1] . $item) > $len) {
                 $texts[] = $item;
-            } else if (strlen($texts[count($texts) - 1] . $item) <= $len) {
-                $texts[count($texts) - 1] .= $item;
             } else {
-                $texts[] = $item;
+                $texts[count($texts) - 1] .= $item;
             }
         }