From: fomichev Date: Wed, 13 Nov 2024 09:27:33 +0000 (+0300) Subject: Проверка строки X-Git-Tag: 1.6~10^2~2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=e50b83013d7dd3474e3f43936475a7a0b55c082d;p=erp24_rep%2Fyii-erp24%2F.git Проверка строки --- 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;