Last modified: 2013-10-23 18:17:31 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 T36322, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34322 - #tag returns junk in front of its displayed value
#tag returns junk in front of its displayed value
Status: NEW
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.18.x
All All
: Low major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-10 17:20 UTC by Dan Barrett
Modified: 2013-10-23 18:17 UTC (History)
1 user (show)

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


Attachments

Description Dan Barrett 2012-02-10 17:20:34 UTC
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".
Comment 1 Brion Vibber 2012-02-10 18:37:54 UTC
IIRC it'll be saving a strip marker; the 'abcde' won't get replaced in until later stages of parsing.

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


Navigation
Links