From: jenkins-bot Date: Mon, 27 Aug 2018 19:10:41 +0000 (+0000) Subject: Merge "Paranoia, escape image alignment parameters before outputting." X-Git-Tag: 1.34.0-rc.0~4298 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=4e021bb8d4741d5af0f02942fe3c33a19e7fabca;hp=-c;p=lhc%2Fweb%2Fwiklou.git Merge "Paranoia, escape image alignment parameters before outputting." --- 4e021bb8d4741d5af0f02942fe3c33a19e7fabca diff --combined includes/Linker.php index 08a57247a6,adc0297065..7e565224cf --- a/includes/Linker.php +++ b/includes/Linker.php @@@ -184,13 -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 { @@@ -205,8 -206,7 +205,8 @@@ */ 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 +431,11 @@@ $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 ); } @@@ -904,7 -908,7 +908,7 @@@ * red if the user has no edits? * @param int $flags Customisation flags (e.g. Linker::TOOL_LINKS_NOBLOCK * and Linker::TOOL_LINKS_EMAIL). - * @param int $edits User edit count (optional, for performance) + * @param int|null $edits User edit count (optional, for performance) * @return string HTML fragment */ public static function userToolLinks( @@@ -966,7 -970,7 +970,7 @@@ * @since 1.16.3 * @param int $userId User identifier * @param string $userText User name or IP address - * @param int $edits User edit count (optional, for performance) + * @param int|null $edits User edit count (optional, for performance) * @return string */ public static function userToolLinksRedContribs( $userId, $userText, $edits = null ) { @@@ -1227,11 -1231,10 +1231,11 @@@ ([^[]*) # 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]; @@@ -1265,11 -1268,7 +1269,11 @@@ $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 = ""; @@@ -1501,7 -1500,7 +1505,7 @@@ * @return string */ public static function tocIndent() { - return "\n