]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Проверка строки
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 13 Nov 2024 09:27:33 +0000 (12:27 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 13 Nov 2024 09:27:33 +0000 (12:27 +0300)
erp24/log/TelegramTarget.php

index b0e1818f93376f91313ad5e81ad8bab294379482..b308b662da549aa3b1a6ae23c1416b05959dfa22 100644 (file)
@@ -53,8 +53,12 @@ class TelegramTarget extends \yii\log\Target
         $currentErrorHash = md5($normalizedCurrentError);
 
         foreach ($errorLines as &$line) {
-            [$date, $count, $hash, $errorText] = explode('|', $line, 4);
-
+            $parts = explode('|', $line, 4);
+            if (count($parts) < 4) {
+                error_log("Некорректная строка: " . $line);
+                continue;
+            }
+            [$date, $count, $hash, $errorText] = $parts;
             // Сравниваем хеши
             if ($hash === $currentErrorHash) {
                 $errorExists = true;