X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ffilerepo%2Ffile%2FFile.php;h=a30d21385150742efb57a24cbf59ebe282363f6c;hb=306fe0ec7cb4c94690bbb788be0c5cb39732ea4c;hp=546b78a0b5f544e3c3256c33cd074bd750c12eab;hpb=285080c3116a1f99285d05e5bb1eab167ea89d6f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index 546b78a0b5..a30d213851 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -2051,34 +2051,34 @@ 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() ) ); + $fname = __METHOD__; return $cache->getWithSetCallback( $key, $this->repo->descriptionCacheExpiry ?: $cache::TTL_UNCACHEABLE, - function ( $oldValue, &$ttl, array &$setOpts ) use ( $renderUrl ) { + function ( $oldValue, &$ttl, array &$setOpts ) use ( $renderUrl, $fname ) { wfDebug( "Fetching shared description from $renderUrl\n" ); - $res = Http::get( $renderUrl, [], __METHOD__ ); + $res = Http::get( $renderUrl, [], $fname ); if ( !$res ) { $ttl = WANObjectCache::TTL_UNCACHEABLE; }