From b8ae369085d1b84ec23375bae6d8c55baf6a38af Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sun, 12 Oct 2008 17:07:09 +0000 Subject: [PATCH] (bug 15952) Don't try to lazy populate sha1 in read-only mode --- includes/filerepo/LocalFile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ), -- 2.20.1