X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fparser%2FCoreParserFunctions.php;h=07944d464896468eafd8f4d3a9d3b1e12d0639a0;hb=ddfb4817b59ec10fa928c4059066f2ef39110ad5;hp=3d262628be4eccf16a9cfdee7f4ef4325c9bf05c;hpb=802c199d0bd80ff0f4d730c61fd58cbf08a52d8d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index 3d262628be..07944d4648 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -875,7 +875,7 @@ class CoreParserFunctions { $code = strtolower( $code ); $inLanguage = strtolower( $inLanguage ); $lang = Language::fetchLanguageName( $code, $inLanguage ); - return $lang !== '' ? $lang : wfBCP47( $code ); + return $lang !== '' ? $lang : LanguageCode::bcp47( $code ); } /** @@ -930,7 +930,8 @@ class CoreParserFunctions { */ public static function anchorencode( $parser, $text ) { $text = $parser->killMarkers( $text ); - return (string)substr( $parser->guessSectionNameFromWikiText( $text ), 1 ); + $section = (string)substr( $parser->guessSectionNameFromWikiText( $text ), 1 ); + return Sanitizer::safeEncodeAttribute( $section ); } public static function special( $parser, $text ) {