Merge "Turn ApiPrefixUniquenessTest into a structure test"
[lhc/web/wiklou.git] / includes / filerepo / file / File.php
index 546b78a..5a0cf6a 100644 (file)
@@ -2051,26 +2051,25 @@ abstract class File implements IDBAccessObject {
        /**
         * Get the HTML text of the description page, if available
         *
-        * @param bool|Language $lang Optional language to fetch description in
+        * @param Language|null $lang Optional language to fetch description in
         * @return string|false
         */
-       function getDescriptionText( $lang = false ) {
+       function getDescriptionText( Language $lang = null ) {
                global $wgLang;
 
                if ( !$this->repo || !$this->repo->fetchDescription ) {
                        return false;
                }
 
-               $lang = $lang ?: $wgLang;
+               $lang = $lang ?? $wgLang;
 
                $renderUrl = $this->repo->getDescriptionRenderUrl( $this->getName(), $lang->getCode() );
                if ( $renderUrl ) {
                        $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
                        $key = $this->repo->getLocalCacheKey(
                                'RemoteFileDescription',
-                               'url',
                                $lang->getCode(),
-                               $this->getName()
+                               md5( $this->getName() )
                        );
 
                        return $cache->getWithSetCallback(