}
$name = Sanitizer::escapeClass( 'page-' . $title->getPrefixedText() );
+ $root = Sanitizer::escapeClass( 'rootpage-' . $title->getRootTitle()->getPrefixedText() );
- return "$numeric $type $name";
+ return "$numeric $type $name $root";
}
/**
if ( $out->isArticle() && MWNamespace::hasSubpages( $out->getTitle()->getNamespace() ) ) {
$ptext = $this->getTitle()->getPrefixedText();
- if ( preg_match( '/\//', $ptext ) ) {
+ if ( strpos( $ptext, '/' ) !== false ) {
$links = explode( '/', $ptext );
array_pop( $links );
$c = 0;
$cache = ObjectCache::getMainWANInstance();
$sidebar = $cache->getWithSetCallback(
$cache->makeKey( 'sidebar', $this->getLanguage()->getCode() ),
- $wgSidebarCacheExpiry,
+ MessageCache::singleton()->isDisabled()
+ ? $cache::TTL_UNCACHEABLE // bug T133069
+ : $wgSidebarCacheExpiry,
$callback,
[ 'lockTSE' => 30 ]
);
return $result;
}
- /**
- * Use PHP's magic __call handler to intercept legacy calls to the linker
- * for backwards compatibility.
- *
- * @param string $fname Name of called method
- * @param array $args Arguments to the method
- * @throws MWException
- * @return mixed
- */
- function __call( $fname, $args ) {
- $realFunction = [ 'Linker', $fname ];
- if ( is_callable( $realFunction ) ) {
- wfDeprecated( get_class( $this ) . '::' . $fname, '1.21' );
- return call_user_func_array( $realFunction, $args );
- } else {
- $className = get_class( $this );
- throw new MWException( "Call to undefined method $className::$fname" );
- }
+ /** @deprecated in 1.21 */
+ public function commentBlock( $comment, $title = null, $local = false, $wikiId = null ) {
+ wfDeprecated( __METHOD__, '1.21' );
+ return Linker::commentBlock( $comment, $title, $local, $wikiId );
+ }
+
+ /** @deprecated in 1.21 */
+ public function generateRollback(
+ $rev,
+ IContextSource $context = null,
+ $options = [ 'verify' ]
+ ) {
+ wfDeprecated( __METHOD__, '1.21' );
+ return Linker::generateRollback( $rev, $context, $options );
+ }
+
+ /** @deprecated in 1.21 */
+ public function link( $target, $html = null, $customAttribs = [], $query = [], $options = [] ) {
+ wfDeprecated( __METHOD__, '1.21' );
+ return Linker::link( $target, $html, $customAttribs, $query, $options );
+ }
+
+ /** @deprecated in 1.21 */
+ public function linkKnown(
+ $target,
+ $html = null,
+ $customAttribs = [],
+ $query = [],
+ $options = [ 'known', 'noclasses' ]
+ ) {
+ wfDeprecated( __METHOD__, '1.21' );
+ return Linker::linkKnown( $target, $html, $customAttribs, $query, $options );
+ }
+
+ /** @deprecated in 1.21 */
+ public function userLink( $userId, $userName, $altUserName = false ) {
+ wfDeprecated( __METHOD__, '1.21' );
+ return Linker::userLink( $userId, $userName, $altUserName );
+ }
+
+ /** @deprecated in 1.21 */
+ public function userToolLinks(
+ $userId,
+ $userText,
+ $redContribsWhenNoEdits = false,
+ $flags = 0,
+ $edits = null
+ ) {
+ wfDeprecated( __METHOD__, '1.21' );
+ return Linker::userToolLinks( $userId, $userText, $redContribsWhenNoEdits, $flags, $edits );
}
}