From: Aaron Schulz Date: Tue, 14 May 2013 18:45:34 +0000 (-0700) Subject: Fixed bug in LocalFile::isCacheable(). X-Git-Tag: 1.31.0-rc.0~19668^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=619a3f3b85fb7fc6d900288129e33a611f614621;p=lhc%2Fweb%2Fwiklou.git Fixed bug in LocalFile::isCacheable(). * The metadata field is actually defaulting to "" not null. Change-Id: I745441c7061494db26de7f64dda30b80171c9443 --- diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index b07186d20a..3cb1f41e72 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -1686,8 +1686,9 @@ class LocalFile extends File { * @return bool Whether to cache in RepoGroup (this avoids OOMs) */ function isCacheable() { - $this->load(); // if loaded from cache, metadata will be null if it didn't fit - return $this->metadata !== null + $this->load(); + // If extra data (metadata) was not loaded then it must have been large + return $this->extraDataLoaded && strlen( serialize( $this->metadata ) ) <= self::CACHE_FIELD_MAX_LEN; }