Last modified: 2010-08-23 22:51: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 T26180, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 24180 - Undefined behavior for #arraymap on empty separator
Undefined behavior for #arraymap on empty separator
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
SemanticForms (Other open bugs)
unspecified
All All
: Normal minor (vote)
: ---
Assigned To: Yaron Koren
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-29 20:01 UTC by Christoph Burgmer
Modified: 2010-08-23 22:51 UTC (History)
2 users (show)

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


Attachments
Patch solving the bug by implementing described solution (2.38 KB, patch)
2010-06-29 20:01 UTC, Christoph Burgmer
Details

Description Christoph Burgmer 2010-06-29 20:01:12 UTC
Created attachment 7529 [details]
Patch solving the bug by implementing described solution

Parser extension function #arraymap allows for the specification of a user defined separator. If an empty separator is passed with for example {{#arraymap:12345||x|[[x]]}} it is directly passed on to explode() which yields a warning on the resulting HTML page.

While the current implementation doesn't offer a defined result for this case, I believe a meaning could be attached to it solving this issue.

There is currently no way to apply #arraymap to a list of characters without a separator, e.g. for separating the digits in the example above. For this use case #arraymap should break around the "empty" space between the digits. This motivates my solution of using separator='' to yield a list of single characters for a given string. The attached patch implements this behavior.
Comment 1 Yaron Koren 2010-08-23 22:51:48 UTC
This patch was added in SF version 2.0 - thanks for the code!

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


Navigation
Links