From d8a4b6ba91c3a0da8d47275071fd9c97f70b7b30 Mon Sep 17 00:00:00 2001 From: Thiemo Kreuz Date: Tue, 2 Feb 2021 08:57:44 +0100 Subject: [PATCH] Add missing isset() check to ApiEchoUnreadNotificationPages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …::getUnreadNotificationPagesFromForeign(). I'm not 100% sure if this fixes the code in a way it is supposed to work. However, I see that getFromForeign() is called 3 times in existing code, and 2 of these places already do an isset() check. It looks like it was just forgotten here. Even if there is another issue to fix here, this patch: a) silences the error, and b) gives us more useful debug output. Bug: T273479 Change-Id: I257620f646196c0554b9d86c849a02f5a8b9519c --- includes/api/ApiEchoUnreadNotificationPages.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/api/ApiEchoUnreadNotificationPages.php b/includes/api/ApiEchoUnreadNotificationPages.php index 4a1b888d7..826859456 100644 --- a/includes/api/ApiEchoUnreadNotificationPages.php +++ b/includes/api/ApiEchoUnreadNotificationPages.php @@ -171,7 +171,9 @@ class ApiEchoUnreadNotificationPages extends ApiQueryBase { protected function getUnreadNotificationPagesFromForeign() { $result = []; foreach ( $this->getFromForeign() as $wiki => $data ) { - $result[$wiki] = $data['query'][$this->getModuleName()][$wiki]; + if ( isset( $data['query'][$this->getModuleName()][$wiki] ) ) { + $result[$wiki] = $data['query'][$this->getModuleName()][$wiki]; + } } return $result;