From 2e07d1844bbc630405d507e219f94cb278850808 Mon Sep 17 00:00:00 2001 From: Daniel Cannon Date: Tue, 16 Oct 2007 09:24:16 +0000 Subject: [PATCH] (bug 11343) If the database is read-only, ensure that undelete fails. --- RELEASE-NOTES | 1 + includes/SpecialUndelete.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 544d594de3..6ee82f78fb 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -104,6 +104,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 11612) Days to show in recent changes cannot be larger than 7 * (bug 11131) Change filearchive width/height columns to int for Postgres * Support plural in undeleted{revisions,revisions-files,files} +* (bug 11343) If the database is read-only, ensure that undelete fails. === API changes in 1.12 === diff --git a/includes/SpecialUndelete.php b/includes/SpecialUndelete.php index d6565cf939..786b4c9394 100644 --- a/includes/SpecialUndelete.php +++ b/includes/SpecialUndelete.php @@ -378,6 +378,8 @@ class PageArchive { * @return int number of revisions restored */ private function undeleteRevisions( $timestamps ) { + if ( wfReadOnly() ) return 0; + $restoreAll = empty( $timestamps ); $dbw = wfGetDB( DB_MASTER ); -- 2.20.1