From: Aaron Schulz Date: Wed, 24 Apr 2013 00:17:50 +0000 (-0700) Subject: Fix bug in OOM avoidance for RepoGroup cache. X-Git-Tag: 1.31.0-rc.0~19884^2 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=042baf43bdc60ef432bb5dc6c889226e62b06404;p=lhc%2Fweb%2Fwiklou.git Fix bug in OOM avoidance for RepoGroup cache. Change-Id: Ic2e7fb6a9a7207315fd65454d883b84278efafc0 --- diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 8bd83769bc..325c6739a2 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -1663,11 +1663,11 @@ class LocalFile extends File { } /** - * @return bool + * @return bool Whether to cache in RepoGroup (this avoids OOMs) */ function isCacheable() { - $this->load(); - return strlen( $this->metadata ) <= self::CACHE_FIELD_MAX_LEN; // avoid OOMs + $this->load(); // if loaded from cache, metadata will be null if it didn't fit + return $this->metadata !== null && strlen( $this->metadata ) <= self::CACHE_FIELD_MAX_LEN; } /**