From a0cb29f1a2146a3a3ba8e1911f20f3bf1c93b270 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Sun, 19 Sep 2021 01:39:22 +0200 Subject: [PATCH] Check for empty strings in markasread query param explode always returns an array with one item, even for the empty string Filter out every possible empty string Change-Id: I0cf0794c0f3e0eedab7e5626e973d8458b28e46a --- includes/EchoHooks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/EchoHooks.php b/includes/EchoHooks.php index 974b381d2..778c9d1ac 100644 --- a/includes/EchoHooks.php +++ b/includes/EchoHooks.php @@ -857,7 +857,7 @@ class EchoHooks implements RecentChange_saveHook { } // Attempt to mark as read the event IDs in the ?markasread= parameter, if present - $markAsReadIds = explode( '|', $request->getText( 'markasread' ) ); + $markAsReadIds = array_filter( explode( '|', $request->getText( 'markasread' ) ) ); $markAsReadWiki = $request->getText( 'markasreadwiki', wfWikiID() ); $markAsReadLocal = !$wgEchoCrossWikiNotifications || $markAsReadWiki === wfWikiID(); if ( $markAsReadIds ) {