Page MenuHomePhabricator

Linter does not detect invalid "500px500px" as a bogus file option
Open, MediumPublic



I came across this invalid sizing option in the wild: (number)px(number)px. Valid options are:


The file specification in question has an unnamed caption parameter, which is interpreted correctly, so it looks like the "px" parameter is being read as a sizing parameter, but it is invalid and is not processed. If I change it to "500p", it is correctly flagged by Linter as extra text.

"500px500px" should be flagged as a Bogus file option by Linter.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 13 2019, 8:05 AM
Jonesey95 added a comment.EditedFeb 13 2019, 9:54 AM

See also the second example here:

It contains "600 px" as a setting. It is similarly invalid, not processed, and not marked as bogus.

(Edited to add: I have updated Help:Images on the MediaWiki site to document this behavior. If it is a feature, then you can ignore this second example, since it is documented now. If it's a bug, let me know here, and I'll correct the documentation. Thanks.)

Jonesey95 added a comment.EditedFeb 19 2019, 8:43 PM

Possibly related: "left150px" is not recognized as a bogus option.

[File:Israeli Ballot Divider.JPG|thumb|left150px|Israeli poll booth]

It does not resize to 150px, it does not place the image on the left, and it does not show a Linter error. At least one of those behaviors appears to be a bug.

ssastry triaged this task as Medium priority.Mar 11 2019, 5:08 PM
ssastry moved this task from Backlog to Parsoid on the MediaWiki-extensions-Linter board.
Aklapper edited projects, added Parsoid; removed Parsoid-Linter.Feb 29 2020, 5:13 PM
ssastry moved this task from Needs Triage to Linting on the Parsoid board.Feb 29 2020, 6:04 PM
Jonesey95 added a comment.EditedJul 5 2020, 7:55 PM

Another flavor that is not detected as a Linter error (extra "300px" parameter):

[[File:Standard of Macdonald of Clanranald.svg|thumb|300px|300px|[[Heraldic standard]] of the current clan chief.]]


[[File:Michna Ceska maryanska muzyka.jpg|250px|right|thumb|x216px|Caption]]