mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix: Remove superfluous antislash from event name to avoid problems
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
3bc43b2a34
commit
bb2cb45340
1 changed files with 4 additions and 0 deletions
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue