From bb2cb45340225e0e72540ecaf42a31c58376f5aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 10 Jun 2024 16:25:12 +0200 Subject: [PATCH] fix: Remove superfluous antislash from event name to avoid problems MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/webhooks/lib/Db/WebhookListenerMapper.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/webhooks/lib/Db/WebhookListenerMapper.php b/apps/webhooks/lib/Db/WebhookListenerMapper.php index 78c3ea6ec4f..7d7360431dc 100644 --- a/apps/webhooks/lib/Db/WebhookListenerMapper.php +++ b/apps/webhooks/lib/Db/WebhookListenerMapper.php @@ -81,6 +81,8 @@ class WebhookListenerMapper extends QBMapper { AuthMethod $authMethod, ?array $authData, ): WebhookListener { + /* Remove any superfluous antislash */ + $event = ltrim($event, '\\'); if (!class_exists($event) || !is_a($event, IWebhookCompatibleEvent::class, true)) { throw new \UnexpectedValueException("$event is not an event class compatible with webhooks"); } @@ -116,6 +118,8 @@ class WebhookListenerMapper extends QBMapper { AuthMethod $authMethod, ?array $authData, ): WebhookListener { + /* Remove any superfluous antislash */ + $event = ltrim($event, '\\'); if (!class_exists($event) || !is_a($event, IWebhookCompatibleEvent::class, true)) { throw new \UnexpectedValueException("$event is not an event class compatible with webhooks"); }