From df8f752a726a14ad21242e0eb8aa390a0f7f38b9 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 26 Jan 2006 07:02:53 +0000 Subject: [PATCH] Fixed Special:Unlockdb, had been broken since 1.5beta1 --- includes/DefaultSettings.php | 2 +- includes/GlobalFunctions.php | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 165e25a764..ce5dca0414 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -699,7 +699,7 @@ $wgDebugRedirects = false; $wgDebugRawPage = false; # Avoid overlapping debug entries by leaving out CSS $wgDebugComments = false; -$wgReadOnly = false; +$wgReadOnly = null; $wgLogQueries = false; /** diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index ceb5fa9326..6454389bb8 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -284,21 +284,19 @@ function logProfilingData() { function wfReadOnly() { global $wgReadOnlyFile, $wgReadOnly; - if ( $wgReadOnly ) { - return true; + if ( !is_null( $wgReadOnly ) ) { + return (bool)$wgReadOnly; } if ( '' == $wgReadOnlyFile ) { return false; } - - // Set $wgReadOnly and unset $wgReadOnlyFile, for faster access next time + // Set $wgReadOnly for faster access next time if ( is_file( $wgReadOnlyFile ) ) { $wgReadOnly = file_get_contents( $wgReadOnlyFile ); } else { $wgReadOnly = false; } - $wgReadOnlyFile = ''; - return $wgReadOnly; + return (bool)$wgReadOnly; } -- 2.20.1