Fixed LocalFile::isCacheable() to account for object type metadata.
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 14 May 2013 18:06:35 +0000 (11:06 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 14 May 2013 18:06:35 +0000 (11:06 -0700)
Change-Id: I8104201c84ea008446df587650a098f6732b8d39

includes/filerepo/file/LocalFile.php

index 932a1d4..b07186d 100644 (file)
@@ -1687,7 +1687,8 @@ class LocalFile extends File {
         */
        function isCacheable() {
                $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;
+               return $this->metadata !== null
+                       && strlen( serialize( $this->metadata ) ) <= self::CACHE_FIELD_MAX_LEN;
        }
 
        /**