Fixed Special:Unlockdb, had been broken since 1.5beta1
authorTim Starling <tstarling@users.mediawiki.org>
Thu, 26 Jan 2006 07:02:53 +0000 (07:02 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Thu, 26 Jan 2006 07:02:53 +0000 (07:02 +0000)
includes/DefaultSettings.php
includes/GlobalFunctions.php

index 165e25a..ce5dca0 100644 (file)
@@ -699,7 +699,7 @@ $wgDebugRedirects           = false;
 $wgDebugRawPage         = false; # Avoid overlapping debug entries by leaving out CSS
 
 $wgDebugComments        = false;
-$wgReadOnly             = false;
+$wgReadOnly             = null;
 $wgLogQueries           = false;
 
 /**
index ceb5fa9..6454389 100644 (file)
@@ -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;
 }