Skip to content

Commit 9de7055

Browse files
committed
Use built-in PHP function to extract query from URL, add changelog entry
1 parent e2ace74 commit 9de7055

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
77
### Notes
88
- [:ledger: View file changes][Unreleased]
99
### Added
10+
- Allow webhook to contain custom query parameters.
1011
### Changed
1112
### Deprecated
1213
### Removed

src/BotManager.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ public function validateAndSetWebhook(): self
236236
}
237237
return !empty($v);
238238
}, ARRAY_FILTER_USE_BOTH);
239-
$webhook['url'] .= ( isset(parse_url($webhook['url'])['query'])) ? '&' : '?' ;
239+
240+
$webhook['url'] .= parse_url($webhook['url'], PHP_URL_QUERY) === null ? '?' : '&';
240241
$this->handleOutput(
241242
$this->telegram->setWebhook(
242243
$webhook['url'] . 'a=handle&s=' . $this->params->getBotParam('secret'),

0 commit comments

Comments
 (0)