Browse Source

TelegramBotHandler: skipping messages containing only whitespace (#1992)

#fixes https://github.com/Seldaek/monolog/issues/1991
Dawid Nowak 2 tháng trước cách đây
mục cha
commit
6b44f0a064
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      src/Monolog/Handler/TelegramBotHandler.php

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

@@ -253,6 +253,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);