X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FXml.php;h=d1a56bf78e6dd10df5d9fcefbb93d13c2b9946d6;hb=e2e9117a51f5c08e32817f474e1c7b2882307785;hp=8c65461680b9c66eb24f41d90fc1681d4eda679c;hpb=03608896716851972cc22d28d432d233be10edba;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Xml.php b/includes/Xml.php index 8c65461680..d1a56bf78e 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -20,6 +20,8 @@ * @file */ +use MediaWiki\MediaWikiServices; + /** * Module of static functions for generating XML */ @@ -79,9 +81,8 @@ class Xml { } /** - * Format an XML element as with self::element(), but run text through the - * $wgContLang->normalize() validator first to ensure that no invalid UTF-8 - * is passed. + * Format an XML element as with self::element(), but run text through the content language's + * normalize() validator first to ensure that no invalid UTF-8 is passed. * * @param string $element * @param array $attribs Name=>value pairs. Values will be escaped. @@ -89,12 +90,12 @@ class Xml { * @return string */ public static function elementClean( $element, $attribs = [], $contents = '' ) { - global $wgContLang; if ( $attribs ) { $attribs = array_map( [ 'UtfNormal\Validator', 'cleanUp' ], $attribs ); } if ( $contents ) { - $contents = $wgContLang->normalize( $contents ); + $contents = + MediaWikiServices::getInstance()->getContentLanguage()->normalize( $contents ); } return self::element( $element, $attribs, $contents ); } @@ -453,7 +454,7 @@ class Xml { /** * Convenience function to build an HTML submit button * When $wgUseMediaWikiUIEverywhere is true it will default to a progressive button - * @param string $value Label text for the button + * @param string $value Label text for the button (unescaped) * @param array $attribs Optional custom attributes * @return string HTML */