From: Tim Starling Date: Thu, 26 Jan 2006 07:02:53 +0000 (+0000) Subject: Fixed Special:Unlockdb, had been broken since 1.5beta1 X-Git-Tag: 1.6.0~422 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=commitdiff_plain;h=df8f752a726a14ad21242e0eb8aa390a0f7f38b9;p=lhc%2Fweb%2Fwiklou.git Fixed Special:Unlockdb, had been broken since 1.5beta1 --- 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; }