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

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
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