Page MenuHomePhabricator

Special pages that return no results get evaluated as true when transcluded
Open, Needs TriagePublicBUG REPORT

Description

Create a new page with the following content:

{{#if:{{Special:WhatLinksHere/{{FULLPAGENAME}}}}|1|0}}

If the page has no incoming links, then we would expect to see 0. However, we get 1.

Here is a demo.

Same thing happens with Special:RelatedChanges (see the demo) so I infer it's not specific to any one special page.

Event Timeline

Sophivorus updated the task description. (Show Details)
Sophivorus updated the task description. (Show Details)
Sophivorus updated the task description. (Show Details)

Strange thing is that the transclusions seem to be returning an empty string as expected (see the div at the bottom of the demo) so maybe the issue is related to parsing order.

Sophivorus renamed this task from Transcluding special pages that return no results, gets evaluated as true to Special pages that return no results get evaluated as true when transcluded.May 30 2019, 3:02 PM

According to what I wrote in T285609 I think that the problem is connected to the function "insertStripItem()" in:
https://gerrit.wikimedia.org/g/mediawiki/core/+/refs/heads/master/includes/parser/Parser.php#1340
Because:

MARKER_SUFFIX = "-QINU`\"'\x7f";

But I don't know php, and don't understand what the function is doing.