From bcea44e64a61863a5579202e4ff0912af9cc2fe0 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 9 Feb 2013 18:58:56 +0100 Subject: [PATCH] Add some missing readonly checks: * Do not allow working on Special:EditWatchlist * Do not reset all notification markers * Do not delete expired restrictions Change-Id: I7a990c0a80b9c7a6340465dd082a110dafea8f14 --- includes/Title.php | 4 ++++ includes/User.php | 4 ++++ includes/specials/SpecialEditWatchlist.php | 1 + 3 files changed, 9 insertions(+) diff --git a/includes/Title.php b/includes/Title.php index 6aa4cd2521..f59a5fcfa7 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2777,6 +2777,10 @@ class Title { * Purge expired restrictions from the page_restrictions table */ static function purgeExpiredRestrictions() { + if ( wfReadOnly() ) { + return; + } + $dbw = wfGetDB( DB_MASTER ); $dbw->delete( 'page_restrictions', diff --git a/includes/User.php b/includes/User.php index a73414c9d3..c2af93cda5 100644 --- a/includes/User.php +++ b/includes/User.php @@ -2874,6 +2874,10 @@ class User { * the next change of any watched page. */ public function clearAllNotifications() { + if ( wfReadOnly() ) { + return; + } + global $wgUseEnotif, $wgShowUpdatedMarker; if ( !$wgUseEnotif && !$wgShowUpdatedMarker ) { $this->setNewtalk( false ); diff --git a/includes/specials/SpecialEditWatchlist.php b/includes/specials/SpecialEditWatchlist.php index 40971c78bd..7e1b44a4ad 100644 --- a/includes/specials/SpecialEditWatchlist.php +++ b/includes/specials/SpecialEditWatchlist.php @@ -77,6 +77,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { } $this->checkPermissions(); + $this->checkReadOnly(); $this->outputHeader(); -- 2.20.1