https://bugzilla.wikimedia.org/show_bug.cgi?id=34322
Web browser: ---
Bug #: 34322
Summary: #tag returns junk in front of its displayed value
Product: MediaWiki
Version: 1.18.1
Platform: All
OS/Version: All
Status: NEW
Severity: major
Priority: Unprioritized
Component: Parser
AssignedTo: [email protected]
ReportedBy: [email protected]
Classification: Unclassified
Define a simple parser tag extension <junk> that returns "abcde":
<?php
$wgHooks['ParserFirstCallInit'][] = 'efJunk';
function efJunk(&$parser) {
$parser->setHook('junk', 'efJunkCallback');
return true;
}
function efJunkCallback($input, $args, $parser, $frame) {
return 'abcde';
}
When displayed in the wiki, it seems to work fine:
{{#tag:junk}}
==> abcde
But when the value is passed to other parser functions, it breaks:
{{#len:{{#tag:junk}}}}
==> 1
{{#ifeq:{{#tag:junk}}|abcde|yes|no}}
==> no
Since the value display correctly, I hypothesize that {{#tag:junk}} is
returning a 1-character, null-terminated string in front of "abcde".
--
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l