From: Aaron Schulz Date: Sun, 12 Oct 2008 17:07:09 +0000 (+0000) Subject: (bug 15952) Don't try to lazy populate sha1 in read-only mode X-Git-Tag: 1.31.0-rc.0~44779 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=b8ae369085d1b84ec23375bae6d8c55baf6a38af;p=lhc%2Fweb%2Fwiklou.git (bug 15952) Don't try to lazy populate sha1 in read-only mode --- diff --git a/includes/filerepo/LocalFile.php b/includes/filerepo/LocalFile.php index 3b20d70544..c15afc409e 100644 --- a/includes/filerepo/LocalFile.php +++ b/includes/filerepo/LocalFile.php @@ -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 ),