Page MenuHomePhabricator

Substed #if on empty parameter returns true and otherwise behaves oddly
Closed, ResolvedPublic

Description

Template {{tmp}} contains:
Lorem {{<includeonly>subst:</includeonly>#if:{{{1|}}}|foo [[{{{1}}}]]|bar}} ipsum

Calling {{subst:tmp|x}} gives (correct):
Lorem foo _x_ ipsum

(_x_ = x is hyperlink)

Calling {{subst:tmp}} gives (incorrect):
Lorem foo [[foo [[{{{1}}}]]]] ipsum
Should give:
Lorem bar ipsum


Version: unspecified
Severity: normal
URL: http://en.wikipedia.org/wiki/User:Simetrical/9054b

Details

Reference
bz9054

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:36 PM
bzimport set Reference to bz9054.
bzimport added a subscriber: Unknown Object (MLST).

ayg wrote:

Two weird things:

  1. It picked the true branch when the condition should have been false
  1. The output was mangled in a bizarre fashion ({{{1}}} in the return string is

replaced by the proper return string, literal "foo [[{{{1}}}]]", so we get
literal "foo [[foo [[{{{1}}}]]]]")

ayg wrote:

*** This bug has been marked as a duplicate of 5678 ***