X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fskins%2FSkin.php;h=e2de9ec382fd400180c6a5e22220e0c1811f9553;hb=a3fc6fc46934c546e109ec1db52f61df1bf935b7;hp=4f271c79373a0aa56bf3cd27302cc122cd32a56f;hpb=ee56f00ddf0609082f8ae9a4dc3e6e1b6f54ddfd;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index 4f271c7937..e2de9ec382 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -1093,7 +1093,7 @@ abstract class Skin extends ContextSource { /* these are used extensively in SkinTemplate, but also some other places */ /** - * @param string $urlaction + * @param string|string[] $urlaction * @return string */ static function makeMainPageUrl( $urlaction = '' ) { @@ -1110,7 +1110,7 @@ abstract class Skin extends ContextSource { * URL with the protocol specified. * * @param string $name Name of the Special page - * @param string $urlaction Query to append + * @param string|string[] $urlaction Query to append * @param string|null $proto Protocol to use or null for a local URL * @return string */ @@ -1126,7 +1126,7 @@ abstract class Skin extends ContextSource { /** * @param string $name * @param string $subpage - * @param string $urlaction + * @param string|string[] $urlaction * @return string */ static function makeSpecialUrlSubpage( $name, $subpage, $urlaction = '' ) { @@ -1136,7 +1136,7 @@ abstract class Skin extends ContextSource { /** * @param string $name - * @param string $urlaction + * @param string|string[] $urlaction * @return string */ static function makeI18nUrl( $name, $urlaction = '' ) { @@ -1147,7 +1147,7 @@ abstract class Skin extends ContextSource { /** * @param string $name - * @param string $urlaction + * @param string|string[] $urlaction * @return string */ static function makeUrl( $name, $urlaction = '' ) { @@ -1174,7 +1174,7 @@ abstract class Skin extends ContextSource { /** * this can be passed the NS number as defined in Language.php * @param string $name - * @param string $urlaction + * @param string|string[] $urlaction * @param int $namespace * @return string */ @@ -1188,7 +1188,7 @@ abstract class Skin extends ContextSource { /** * these return an array with the 'href' and boolean 'exists' * @param string $name - * @param string $urlaction + * @param string|string[] $urlaction * @return array */ static function makeUrlDetails( $name, $urlaction = '' ) { @@ -1204,7 +1204,7 @@ abstract class Skin extends ContextSource { /** * Make URL details where the article exists (or at least it's convenient to think so) * @param string $name Article name - * @param string $urlaction + * @param string|string[] $urlaction * @return array */ static function makeKnownUrlDetails( $name, $urlaction = '' ) { @@ -1253,7 +1253,7 @@ abstract class Skin extends ContextSource { * * @return array */ - function buildSidebar() { + public function buildSidebar() { global $wgEnableSidebarCache, $wgSidebarCacheExpiry; $callback = function ( $old = null, &$ttl = null ) { @@ -1267,13 +1267,22 @@ abstract class Skin extends ContextSource { return $bar; }; - $cache = MediaWikiServices::getInstance()->getMainWANObjectCache(); + $msgCache = MessageCache::singleton(); + $wanCache = MediaWikiServices::getInstance()->getMainWANObjectCache(); + $sidebar = $wgEnableSidebarCache - ? $cache->getWithSetCallback( - $cache->makeKey( 'sidebar', $this->getLanguage()->getCode() ), + ? $wanCache->getWithSetCallback( + $wanCache->makeKey( 'sidebar', $this->getLanguage()->getCode() ), $wgSidebarCacheExpiry, $callback, - [ 'lockTSE' => 30 ] + [ + 'checkKeys' => [ + // Unless there is both no exact $code override nor an i18n definition + // in the the software, the only MediaWiki page to check is for $code. + $msgCache->getCheckKey( $this->getLanguage()->getCode() ) + ], + 'lockTSE' => 30 + ] ) : $callback();