(bug 15952) Don't try to lazy populate sha1 in read-only mode
authorAaron Schulz <aaron@users.mediawiki.org>
Sun, 12 Oct 2008 17:07:09 +0000 (17:07 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sun, 12 Oct 2008 17:07:09 +0000 (17:07 +0000)
includes/filerepo/LocalFile.php

index 3b20d70..c15afc4 100644 (file)
@@ -1138,7 +1138,7 @@ class LocalFile extends File
                // Initialise now if necessary
                if ( $this->sha1 == '' && $this->fileExists ) {
                        $this->sha1 = File::sha1Base36( $this->getPath() );
-                       if ( strval( $this->sha1 ) != '' ) {
+                       if ( !wfReadOnly() && strval( $this->sha1 ) != '' ) {
                                $dbw = $this->repo->getMasterDB();
                                $dbw->update( 'image',
                                        array( 'img_sha1' => $this->sha1 ),