*/
use MediaWiki\Logger\LoggerFactory;
+use MediaWiki\MediaWikiServices;
use MediaWiki\Session\SessionManager;
use WrappedString\WrappedString;
use WrappedString\WrappedStringList;
if ( $title->isRedirect() ) {
$query['redirect'] = 'no';
}
+ $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
return wfMessage( 'backlinksubtitle' )
- ->rawParams( Linker::link( $title, null, [], $query ) );
+ ->rawParams( $linkRenderer->makeLink( $title, null, [], $query ) );
}
/**
'OutputPageMakeCategoryLinks',
[ &$this, $categories, &$this->mCategoryLinks ] )
) {
+ $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
foreach ( $categories as $category => $type ) {
// array keys will cast numeric category names to ints, so cast back to string
$category = (string)$category;
}
$text = $wgContLang->convertHtml( $title->getText() );
$this->mCategories[$type][] = $title->getText();
- $this->mCategoryLinks[$type][] = Linker::link( $title, $text );
+ $this->mCategoryLinks[$type][] = $linkRenderer->makeLink( $title, new HtmlArmor( $text ) );
}
}
}
* if there isn't one. This is used by Skin to determine whether to enable
* JavaScript frame-breaking, for clients that don't support X-Frame-Options.
*
- * @return string
+ * @return string|false
*/
public function getFrameOptions() {
$config = $this->getConfig();
$response->header( "Content-Type: text/html; charset=utf-8" );
if ( $config->get( 'DebugRedirects' ) ) {
$url = htmlspecialchars( $redirect );
- print "<html>\n<head>\n<title>Redirect</title>\n</head>\n<body>\n";
+ print "<!DOCTYPE html>\n<html>\n<head>\n<title>Redirect</title>\n</head>\n<body>\n";
print "<p>Location: <a href=\"$url\">$url</a></p>\n";
print "</body>\n</html>\n";
} else {
* @param array $options Options array to pass to Linker
*/
public function addReturnTo( $title, array $query = [], $text = null, $options = [] ) {
+ $linkRenderer = MediaWikiServices::getInstance()
+ ->getLinkRendererFactory()->createFromLegacyOptions( $options );
$link = $this->msg( 'returnto' )->rawParams(
- Linker::link( $title, $text, [], $query, $options ) )->escaped();
+ $linkRenderer->makeLink( $title, $text, [], $query ) )->escaped();
$this->addHTML( "<p id=\"mw-returnto\">{$link}</p>\n" );
}
'site.styles',
'noscript',
'user.styles',
- 'user.cssprefs',
] );
$this->getSkin()->setupSkinUserCss( $this );
$bodyClasses[] = $userdir;
$bodyClasses[] = "sitedir-$sitedir";
+ $underline = $this->getUser()->getOption( 'underline' );
+ if ( $underline < 2 ) {
+ // The following classes can be used here:
+ // * mw-underline-always
+ // * mw-underline-never
+ $bodyClasses[] = 'mw-underline-' . ( $underline ? 'always' : 'never' );
+ }
+
if ( $this->getLanguage()->capitalizeAllNouns() ) {
# A <body> class is probably not the best way to do this . . .
$bodyClasses[] = 'capitalize-all-nouns';