From cd56a97356138520c706067c9e3b9ee89344583f Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 24 Feb 2008 03:50:05 +0000 Subject: [PATCH] * Add wfReadOnlyReason() to supply the reason for the wiki being read only. Use it in OutputPage. --- includes/GlobalFunctions.php | 5 +++++ includes/OutputPage.php | 9 ++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 8556505d2e..286a9b80d4 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -305,6 +305,11 @@ function wfReadOnly() { return (bool)$wgReadOnly; } +function wfReadOnlyReason() { + global $wgReadOnly; + wfReadOnly(); + return $wgReadOnly; +} /** * Get a message from anywhere, for the current user language. diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 917a730c24..f152fac8d3 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1097,7 +1097,7 @@ class OutputPage { * @param array $reasons List of reasons for this error, as returned by Title::getUserPermissionsErrors(). */ public function readOnlyPage( $source = null, $protected = false, $reasons = array() ) { - global $wgUser, $wgReadOnlyFile, $wgReadOnly, $wgTitle; + global $wgUser, $wgTitle; $skin = $wgUser->getSkin(); $this->setRobotpolicy( 'noindex,nofollow' ); @@ -1121,12 +1121,7 @@ class OutputPage { } else { // Wiki is read only $this->setPageTitle( wfMsg( 'readonly' ) ); - if ( $wgReadOnly ) { - $reason = $wgReadOnly; - } else { - // Should not happen, user should have called wfReadOnly() first - $reason = file_get_contents( $wgReadOnlyFile ); - } + $reason = wfReadOnlyReason(); $this->addWikiMsg( 'readonlytext', $reason ); } -- 2.20.1