From e50b83013d7dd3474e3f43936475a7a0b55c082d Mon Sep 17 00:00:00 2001 From: fomichev Date: Wed, 13 Nov 2024 12:27:33 +0300 Subject: [PATCH] =?utf8?q?=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B0?= =?utf8?q?=20=D1=81=D1=82=D1=80=D0=BE=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/log/TelegramTarget.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/erp24/log/TelegramTarget.php b/erp24/log/TelegramTarget.php index b0e1818f..b308b662 100644 --- a/erp24/log/TelegramTarget.php +++ b/erp24/log/TelegramTarget.php @@ -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; -- 2.39.5