X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FLinker.php;h=7e565224cf66a05f425c49bb9f7640c1cffb9cd1;hb=f2e9fb2ee04434c631ca60b07c6f061441895f0d;hp=f160fd67fa759f105ef374ff2272cf6e4341c45a;hpb=05a4432e2a165844b1295401a62ee313a55a5f2d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Linker.php b/includes/Linker.php index f160fd67fa..7e565224cf 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -184,14 +184,13 @@ class Linker { * @return string */ public static function getInvalidTitleDescription( IContextSource $context, $namespace, $title ) { - global $wgContLang; - // First we check whether the namespace exists or not. if ( MWNamespace::exists( $namespace ) ) { if ( $namespace == NS_MAIN ) { $name = $context->msg( 'blanknamespace' )->text(); } else { - $name = $wgContLang->getFormattedNsText( $namespace ); + $name = MediaWikiServices::getInstance()->getContentLanguage()-> + getFormattedNsText( $namespace ); } return $context->msg( 'invalidtitle-knownnamespace', $namespace, $name, $title )->text(); } else { @@ -206,7 +205,8 @@ class Linker { */ public static function normaliseSpecialPage( LinkTarget $target ) { if ( $target->getNamespace() == NS_SPECIAL && !$target->isExternal() ) { - list( $name, $subpage ) = SpecialPageFactory::resolveAlias( $target->getDBkey() ); + list( $name, $subpage ) = MediaWikiServices::getInstance()->getSpecialPageFactory()-> + resolveAlias( $target->getDBkey() ); if ( !$name ) { return $target; } @@ -431,7 +431,11 @@ class Linker { $s = $thumb->toHtml( $params ); } if ( $frameParams['align'] != '' ) { - $s = "
{$s}
"; + $s = Html::rawElement( + 'div', + [ 'class' => 'float' . $frameParams['align'] ], + $s + ); } return str_replace( "\n", ' ', $prefix . $s . $postfix ); } @@ -1227,10 +1231,11 @@ class Linker { ([^[]*) # 3. link trail (the text up until the next link) /x', function ( $match ) use ( $title, $local, $wikiId ) { - global $wgContLang; - $medians = '(?:' . preg_quote( MWNamespace::getCanonicalName( NS_MEDIA ), '/' ) . '|'; - $medians .= preg_quote( $wgContLang->getNsText( NS_MEDIA ), '/' ) . '):'; + $medians .= preg_quote( + MediaWikiServices::getInstance()->getContentLanguage()->getNsText( NS_MEDIA ), + '/' + ) . '):'; $comment = $match[0]; @@ -1264,7 +1269,11 @@ class Linker { $match[1] = substr( $match[1], 1 ); } if ( $match[1] !== false && $match[1] !== '' ) { - if ( preg_match( $wgContLang->linkTrail(), $match[3], $submatch ) ) { + if ( preg_match( + MediaWikiServices::getInstance()->getContentLanguage()->linkTrail(), + $match[3], + $submatch + ) ) { $trail = $submatch[1]; } else { $trail = ""; @@ -1655,8 +1664,7 @@ class Linker { * @return array */ static function splitTrail( $trail ) { - global $wgContLang; - $regex = $wgContLang->linkTrail(); + $regex = MediaWikiServices::getInstance()->getContentLanguage()->linkTrail(); $inside = ''; if ( $trail !== '' ) { $m = [];