Hopefully fix a MWException on User: pages under MW 1.27alpha

Code copypasted from core /includes/skins/BaseTemplate.php, function
makeLink(). Totally, completely and absolutely untested, but it makes
sense, so it should work....right?

Change-Id: I56bc9b62c510bad2d22de149705bb96ffe7aca67
isekai
Jack Phoenix 9 years ago
parent add0480ad6
commit 1bc1d037d4

@ -255,21 +255,27 @@ class TimelessTemplate extends BaseTemplate {
if ( isset( $item['href'] ) ) { if ( isset( $item['href'] ) ) {
$attrs = $item; $attrs = $item;
foreach ( array( 'single-id', 'text', 'msg', 'tooltiponly', 'context', 'primary' ) as $k ) { foreach ( array( 'single-id', 'text', 'msg', 'tooltiponly', 'context', 'primary', 'tooltip-params' ) as $k ) {
unset( $attrs[$k] ); unset( $attrs[$k] );
} }
if ( isset( $item['id'] ) && !isset( $item['single-id'] ) ) { if ( isset( $item['id'] ) && !isset( $item['single-id'] ) ) {
$item['single-id'] = $item['id']; $item['single-id'] = $item['id'];
} }
$tooltipParams = array();
if ( isset( $item['tooltip-params'] ) ) {
$tooltipParams = $item['tooltip-params'];
}
if ( isset( $item['single-id'] ) ) { if ( isset( $item['single-id'] ) ) {
if ( isset( $item['tooltiponly'] ) && $item['tooltiponly'] ) { if ( isset( $item['tooltiponly'] ) && $item['tooltiponly'] ) {
$title = Linker::titleAttrib( $item['single-id'] ); $title = Linker::titleAttrib( $item['single-id'], null, $tooltipParams );
if ( $title !== false ) { if ( $title !== false ) {
$attrs['title'] = $title; $attrs['title'] = $title;
} }
} else { } else {
$tip = Linker::tooltipAndAccesskeyAttribs( $item['single-id'] ); $tip = Linker::tooltipAndAccesskeyAttribs( $item['single-id'], $tooltipParams );
if ( isset( $tip['title'] ) && $tip['title'] !== false ) { if ( isset( $tip['title'] ) && $tip['title'] !== false ) {
$attrs['title'] = $tip['title']; $attrs['title'] = $tip['title'];
} }

Loading…
Cancel
Save