Last modified: 2010-05-15 15:54:48 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T16229, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 14229 - #tag does not ignore whitespace before parameter names
#tag does not ignore whitespace before parameter names
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.12.x
All All
: Normal normal (vote)
: ---
Assigned To: Tim Starling
: need-parsertest, patch, patch-need-review, testme
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-22 19:13 UTC by Dan Barrett
Modified: 2010-05-15 15:54 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patch against 1.12.0 (407 bytes, patch)
2008-05-22 19:31 UTC, Dan Barrett
Details

Description Dan Barrett 2008-05-22 19:13:16 UTC
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".
Comment 1 Dan Barrett 2008-05-22 19:31:14 UTC
Created attachment 4916 [details]
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.)
Comment 2 Dan Barrett 2008-05-22 19:31:52 UTC
Maybe the patch should use ltrim rather than trim?  Up to you....
Comment 3 Siebrand Mazeland 2008-08-16 19:49:40 UTC
Keywords: patch, need-review
Assigned: to Tim for review
Comment 4 Tim Starling 2008-10-06 07:38:10 UTC
Fixed in r41734.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links