Merge "Follow-up 3535a5f327: Remove old CSS now caches have expired"
[lhc/web/wiklou.git] / includes / filerepo / file / File.php
index c3b5199..92be7d4 100644 (file)
@@ -29,6 +29,7 @@ use MediaWiki\MediaWikiServices;
  * @ingroup FileAbstraction
  */
 
+// @phan-file-suppress PhanTypeMissingReturn false positives
 /**
  * Implements some public methods and some protected utility functions which
  * are required by multiple child classes. Contains stub functionality for
@@ -633,20 +634,15 @@ abstract class File implements IDBAccessObject {
                        // one would not expect it to be animated
                        // so true.
                        return true;
-               } else {
-                       if ( $this->allowInlineDisplay()
-                               && $handler->isAnimatedImage( $this )
-                               && !$handler->canAnimateThumbnail( $this )
-                       ) {
-                               // Image is animated, but thumbnail isn't.
-                               // This is unexpected to the user.
-                               return false;
-                       } else {
-                               // Image is not animated, so one would
-                               // not expect thumb to be
-                               return true;
-                       }
                }
+
+               return !$this->allowInlineDisplay()
+                       // Image is not animated, so one would
+                       // not expect thumb to be
+                       || !$handler->isAnimatedImage( $this )
+                       // Image is animated, but thumbnail isn't.
+                       // This is unexpected to the user.
+                       || $handler->canAnimateThumbnail( $this );
        }
 
        /**
@@ -2074,7 +2070,8 @@ abstract class File implements IDBAccessObject {
                                $this->repo->descriptionCacheExpiry ?: $cache::TTL_UNCACHEABLE,
                                function ( $oldValue, &$ttl, array &$setOpts ) use ( $renderUrl, $fname ) {
                                        wfDebug( "Fetching shared description from $renderUrl\n" );
-                                       $res = Http::get( $renderUrl, [], $fname );
+                                       $res = MediaWikiServices::getInstance()->getHttpRequestFactory()->
+                                               get( $renderUrl, [], $fname );
                                        if ( !$res ) {
                                                $ttl = WANObjectCache::TTL_UNCACHEABLE;
                                        }