From: Ævar Arnfjörð Bjarmason Date: Fri, 13 May 2005 09:58:53 +0000 (+0000) Subject: * Save '0' in img_metadata when no metadata has been found, to indicate that X-Git-Tag: 1.5.0alpha2~222 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_supprimer.php?a=commitdiff_plain;h=416ee3f058eea8a16cea535810024f6e26791d73;p=lhc%2Fweb%2Fwiklou.git * Save '0' in img_metadata when no metadata has been found, to indicate that it shouldn't be checked again. --- diff --git a/includes/Image.php b/includes/Image.php index f7660848de..0e0c174c40 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -1167,6 +1167,8 @@ class Image function getExifData () { global $wgRequest; + if ( $this->metadata === '0' ) + return array(); $purge = $wgRequest->getVal( 'action' ) == 'purge'; $ret = unserialize ( $this->metadata ); @@ -1176,7 +1178,6 @@ class Image if ( !count( $ret ) || $purge || $oldver != $newver ) { $this->updateExifData( $newver ); - $ret = unserialize( $this->metadata ); } if ( isset( $ret['MEDIAWIKI_EXIF_VERSION'] ) ) unset( $ret['MEDIAWIKI_EXIF_VERSION'] ); @@ -1196,8 +1197,12 @@ class Image # Get EXIF data from image $exif = $this->retrieveExifData(); - $exif['MEDIAWIKI_EXIF_VERSION'] = $version; - $this->metadata = serialize( $exif ); + if ( count( $exif ) ) { + $exif['MEDIAWIKI_EXIF_VERSION'] = $version; + $this->metadata = serialize( $exif ); + } else { + $this->metadata = '0'; + } # Update EXIF data in database $dbw =& wfGetDB( DB_MASTER );