diff --git a/module/oc_telegram_shop/upload/oc_telegram_shop/bastion/Handlers/LogsHandler.php b/module/oc_telegram_shop/upload/oc_telegram_shop/bastion/Handlers/LogsHandler.php index 8a035f4..d07a402 100755 --- a/module/oc_telegram_shop/upload/oc_telegram_shop/bastion/Handlers/LogsHandler.php +++ b/module/oc_telegram_shop/upload/oc_telegram_shop/bastion/Handlers/LogsHandler.php @@ -79,6 +79,8 @@ class LogsHandler // Форматируем дату для отображения (убираем микросекунды и временную зону для читаемости) $formattedDatetime = $this->formatDateTime($datetime); + $message = rtrim($message, ' [] []'); + $parsed[] = [ 'datetime' => $formattedDatetime, 'datetime_raw' => $datetime, diff --git a/module/oc_telegram_shop/upload/oc_telegram_shop/framework/Telegram/SignatureValidator.php b/module/oc_telegram_shop/upload/oc_telegram_shop/framework/Telegram/SignatureValidator.php index 1f7ecc5..61504e7 100755 --- a/module/oc_telegram_shop/upload/oc_telegram_shop/framework/Telegram/SignatureValidator.php +++ b/module/oc_telegram_shop/upload/oc_telegram_shop/framework/Telegram/SignatureValidator.php @@ -64,6 +64,7 @@ class SignatureValidator $calculatedHash = bin2hex(hash_hmac($algorithm, $checkString, $secretKey, true)); if (! hash_equals($calculatedHash, $data['hash'])) { + $this->logger->error('Request with invalid Telegram Signature. Check Telegram Bot Token is correct.'); throw new TelegramInvalidSignatureException('Invalid Telegram signature!'); } } diff --git a/module/oc_telegram_shop/upload/oc_telegram_shop/src/Exceptions/CustomExceptionHandler.php b/module/oc_telegram_shop/upload/oc_telegram_shop/src/Exceptions/CustomExceptionHandler.php index a6213d5..d834d8d 100755 --- a/module/oc_telegram_shop/upload/oc_telegram_shop/src/Exceptions/CustomExceptionHandler.php +++ b/module/oc_telegram_shop/upload/oc_telegram_shop/src/Exceptions/CustomExceptionHandler.php @@ -6,6 +6,7 @@ use Openguru\OpenCartFramework\Contracts\ExceptionHandlerInterface; use Openguru\OpenCartFramework\Http\JsonResponse; use Openguru\OpenCartFramework\Http\Response; use Openguru\OpenCartFramework\Telegram\Exceptions\TelegramInvalidSignatureException; +use Psr\Log\LoggerInterface; use Throwable; class CustomExceptionHandler implements ExceptionHandlerInterface