From baddcab658195e9f2438b24f15030564e2fbd925 Mon Sep 17 00:00:00 2001 From: Arlo Breault Date: Wed, 7 Jan 2015 12:03:02 -0800 Subject: [PATCH] T105242: U is for urlencode * Urlencode and extension tags don't play nice. The current behaviour is pretty broken. For example, {{urlencode:
two
}} outputs
two
which isn't exactly urlencoded. * Just drop the unexpanded content; anything more seems unsafe. There's precedent for this already in anchorencode. * Noticed in the infobox caption for enwiki/%22F%22_Is_for_Fugitive Change-Id: I0ec5d2fdeb71f762036464f65029afd029e8b4a1 --- includes/parser/CoreParserFunctions.php | 4 +++- tests/parser/parserTests.txt | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index cf8cd41009..8a30ad1a22 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -178,7 +178,9 @@ class CoreParserFunctions { default: $func = 'urlencode'; } - return $parser->markerSkipCallback( $s, $func ); + // See T105242, where the choice to kill markers and various + // other options were discussed. + return $func( $parser->killMarkers( $s ) ); } public static function lcfirst( $parser, $s = '' ) { diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 1670fe4cc5..c70f8b2ae6 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -19846,10 +19846,12 @@ Strip marker in urlencode {{urlencode:xy}} {{urlencode:xy|wiki}} {{urlencode:xy|path}} +{{urlencode:x
two
y}} !! html

xy xy xy +xy

!! end -- 2.20.1