From: Kunal Mehta Date: Sat, 25 Aug 2018 08:20:43 +0000 (-0700) Subject: parser: Simplify code for {{#int:}} if the message doesn't exist X-Git-Tag: 1.34.0-rc.0~4307 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=2912873a61fd2f00fed4b2b8a308a026d4b06d7d;p=lhc%2Fweb%2Fwiklou.git parser: Simplify code for {{#int:}} if the message doesn't exist Ever since 184658eb32f6, the output of a non-existing message will be HTML safe, regardless of output format, so we can treat non-existing messages exactly the same as messages that do exist. The pre-existing "int keyword - non-existing message" parser test verifies that no change in output has ocurred in this patch. Change-Id: I0e32be14f1b420d7f222ac3c76e1cc266f912b69 --- diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index 1f5308fbdc..d44ac8c8f0 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -98,11 +98,6 @@ class CoreParserFunctions { $args = array_slice( func_get_args(), 2 ); $message = wfMessage( $part1, $args ) ->inLanguage( $parser->getOptions()->getUserLangObj() ); - if ( !$message->exists() ) { - // When message does not exists, the message name is surrounded by angle - // and can result in a tag, therefore escape the angles - return $message->escaped(); - } return [ $message->plain(), 'noparse' => false ]; } else { return [ 'found' => false ];