From 619a3f3b85fb7fc6d900288129e33a611f614621 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 14 May 2013 11:45:34 -0700 Subject: [PATCH] Fixed bug in LocalFile::isCacheable(). * The metadata field is actually defaulting to "" not null. Change-Id: I745441c7061494db26de7f64dda30b80171c9443 --- includes/filerepo/file/LocalFile.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } -- 2.20.1