Page MenuHomePhabricator

Linter does not detect invalid "500px500px" as a bogus file option
Closed, ResolvedPublic



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

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.)

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.

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]]

Change 661820 had a related patch set uploaded (by Sbailey; owner: Sbailey):
[mediawiki/services/parsoid@master] WIP Catch invalid image link parameters

Change 665226 had a related patch set uploaded (by Arlolra; owner: Sbailey):
[mediawiki/services/parsoid@master] Lint duplicated media width options

Change 661820 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Lint bogus media width options

Change 665226 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Lint duplicated media width options

Fixed by patches:

which addresses bogus width options, and

which addresses duplicate width options.

Change 666213 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.13.0-a25

Change 666213 merged by jenkins-bot:
[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.13.0-a25