File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
66## [ Unreleased]
77### Added
88### Changed
9+ - Use the new Telegram API webhook IP ranges.
910### Deprecated
1011### Removed
1112### Fixed
Original file line number Diff line number Diff line change 2121class BotManager
2222{
2323 /**
24- * @var string Telegram post servers IP range
24+ * @var array Telegram webhook servers IP ranges
25+ * @link https://core.telegram.org/bots/webhooks#the-short-version
2526 */
26- const TELEGRAM_IP_RANGE = '149.154.167.197-149.154.167.233 ' ;
27+ public const TELEGRAM_IP_RANGES = [ '149.154.160.0/20 ' , ' 91.108.4.0/22 ' ] ;
2728
2829 /**
2930 * @var string The output for testing, instead of echoing
@@ -578,7 +579,7 @@ public function isValidRequest(): bool
578579 }
579580
580581 return Ip::match ($ ip , array_merge (
581- [ self ::TELEGRAM_IP_RANGE ] ,
582+ self ::TELEGRAM_IP_RANGES ,
582583 (array ) $ this ->params ->getBotParam ('valid_ips ' , [])
583584 ));
584585 }
You can’t perform that action at this time.
0 commit comments