From f31ea59a1afd4129dbe0599eb4aadcafa089fd2d Mon Sep 17 00:00:00 2001 From: rxu Date: Tue, 2 Jan 2024 01:33:13 +0700 Subject: [PATCH 1/2] [ticket/17117] Do not load non-existent/disabled notification methods Non-existent or disabled notification methods (f.e. added by extensions which were later disabled/purged) should not be loaded. PHPBB3-17117 --- phpBB/phpbb/notification/manager.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index 8bc2c04baa..05572c346b 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -411,12 +411,17 @@ class manager foreach ($methods as $method) { - // setup the notification methods and add the notification to the queue + // Do not load non-existent notification methods + if (!isset($this->notification_methods[$method])) + { + continue; + } + + // Setup the notification methods and add the notification to the queue if (!isset($notification_methods[$method])) { $notification_methods[$method] = $this->get_method_class($method); } - $notification_methods[$method]->add_to_queue($notification); } } From 887b1e25fbed40b3c84f977d44bda821be8d017b Mon Sep 17 00:00:00 2001 From: rxu Date: Tue, 2 Jan 2024 16:30:44 +0700 Subject: [PATCH 2/2] [ticket/17117] Add test for non=existent notification method PHPBB3-17117 --- .../fixtures/submit_post_notification.type.bookmark.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/notification/fixtures/submit_post_notification.type.bookmark.xml b/tests/notification/fixtures/submit_post_notification.type.bookmark.xml index db1cef2ef6..b6163e9ed0 100644 --- a/tests/notification/fixtures/submit_post_notification.type.bookmark.xml +++ b/tests/notification/fixtures/submit_post_notification.type.bookmark.xml @@ -159,5 +159,12 @@ notification.method.board 0 + + notification.type.bookmark + 0 + 3 + notification.method.nonexistent + 1 +