Page MenuHomePhabricator

#tag does not ignore whitespace before parameter names
Closed, ResolvedPublic

Description

The #tag magic word does not ignore whitespace when it should. In this example for the <foobar> tag:

{{#tag:foobar

some data
param=value

}}

The foobar tag extension will be passed the parameter ' param' (with a leading space character) instead of 'param'. In other words, in the tag extension code:

function render($input, $argv) {
...
}

$argv['param'] will be unset, but $argv[' param'] will be set. This seems wrong. #tag should ignore the whitespace between the "|" and "param=value".


Version: 1.12.x
Severity: normal

Details

Reference
bz14229

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:10 PM
bzimport set Reference to bz14229.

Created attachment 4916
Patch against 1.12.0

This patch simply trims the whitespace around the parameter name. (I think it would be incorrect to trim whitespace around the parameter value.)

Attached:

Maybe the patch should use ltrim rather than trim? Up to you....

Keywords: patch, need-review
Assigned: to Tim for review