Fixed total breakage of the local message cache since r30437
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 10 Feb 2008 14:29:17 +0000 (14:29 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 10 Feb 2008 14:29:17 +0000 (14:29 +0000)
includes/MessageCache.php

index 976cd96..755d379 100644 (file)
@@ -74,15 +74,6 @@ class MessageCache {
                }
 
                if ( $wgLocalMessageCacheSerialized ) {
-                       $localHash=substr(fread($file,40),8);
-                       fclose($file);
-                       if ($hash!=$localHash) {
-                               return;
-                       }
-
-                       require("$wgLocalMessageCache/messages-" . wfWikiID());
-                       $this->setCache( $this->mCache);
-               } else {
                        // Check to see if the file has the hash specified
                        $localHash = fread( $file, 32 );
                        if ( $hash === $localHash ) {
@@ -91,6 +82,15 @@ class MessageCache {
                                $this->setCache( unserialize( $serialized ) );
                        }
                        fclose( $file );
+               } else {
+                       $localHash=substr(fread($file,40),8);
+                       fclose($file);
+                       if ($hash!=$localHash) {
+                               return;
+                       }
+
+                       require("$wgLocalMessageCache/messages-" . wfWikiID());
+                       $this->setCache( $this->mCache);
                }
        }