From: Arlo Breault Date: Wed, 7 Jan 2015 20:03:02 +0000 (-0800) Subject: T105242: U is for urlencode X-Git-Tag: 1.31.0-rc.0~10837^2 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=baddcab658195e9f2438b24f15030564e2fbd925;p=lhc%2Fweb%2Fwiklou.git 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 --- 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