Переглянути джерело

TelegramBotHandler: skipping messages containing only whitespace (#1992)

#fixes https://github.com/Seldaek/monolog/issues/1991
Dawid Nowak 2 місяців тому
батько
коміт
28961f4174
1 змінених файлів з 4 додано та 0 видалено
  1. 4 0
      src/Monolog/Handler/TelegramBotHandler.php

+ 4 - 0
src/Monolog/Handler/TelegramBotHandler.php

@@ -233,6 +233,10 @@ class TelegramBotHandler extends AbstractProcessingHandler
 
     protected function sendCurl(string $message): void
     {
+        if ('' === trim($message)) {
+            return;
+        }
+        
         $ch = curl_init();
         $url = self::BOT_API . $this->apiKey . '/SendMessage';
         curl_setopt($ch, CURLOPT_URL, $url);