fix #2435 handle missing event names in webhook dispatcher (#2440)

This commit is contained in:
sangege
2026-07-12 04:36:25 +08:00
committed by GitHub
parent f44ad34dc3
commit 1f2ff09a8b

View File

@@ -100,6 +100,10 @@ class DispatchWebhooks
{
$eventName = $activityLogged->model->event;
if ($eventName === null) {
return;
}
if (!$activityLogged->isServerEvent()) {
return;
}
@@ -177,6 +181,10 @@ class DispatchWebhooks
$eventName = $activityLogged->model->event;
$activityLoggedClass = ActivityLogged::class;
if ($eventName === null) {
return;
}
$matchingHooks = collect();
if ($this->eventIsWatched($eventName)) {
@@ -210,8 +218,12 @@ class DispatchWebhooks
}
}
protected function eventIsWatched(string $eventName): bool
protected function eventIsWatched(?string $eventName): bool
{
if ($eventName === null) {
return false;
}
$watchedEvents = cache()->rememberForever('watchedWebhooks', function () {
return WebhookConfiguration::where('scope', WebhookScope::Global)
->pluck('events')