Steps to replicate the issue (include links if applicable):
What happens?:
What should have happened instead?:
No codes
| AlexisJazz | |
| Jun 5 2026, 9:09 PM |
| F86822710: span plainlinks exif wut.png | |
| Jun 5 2026, 9:09 PM |
Steps to replicate the issue (include links if applicable):
What happens?:
What should have happened instead?:
No codes
| Subject | Author | Repo | Branch | Lines +/- | |
|---|---|---|---|---|---|
| FormatMetadata: Fix double-escaping of lang-typed metadata values | HakanIST | mediawiki/core | master | +17 -3 |
Metadata is normal, so i suspect this is due to customization on commons.
Metadata value:
{ "name": "Model", "value": [ { "name": "x-default", "value": "Canon PowerShot G7 X Mark III" }, { "name": "_type", "value": "lang" } ] },
Like presumably its a problem with https://commons.wikimedia.org/wiki/Template:Exif-model-value but i dont see how it is happening
Other files seem to be fine, and {{Exif-model-value|Canon PowerShot G7 X Mark III}} seems to be fine on a normal page, so im really not sure what is happening here. Super weird.
I think this is a double-escaping in FormatMetadata::langItem() PNGs store Model/Make as _type: lang via PNGMetadataExtractor, so they go through langItem() which calls htmlspecialchars() on the already-formatted exifMsg() output. JPEGs have plain strings and skip langItem() entirely.
The template edit made it visible because the old [[w:...|...]] syntax is not affected by htmlspecialchars(), but the new <span>/<nowiki> tags are. Affects all PNG files with camera metadata.
Found the same on https://commons.wikimedia.org/wiki/File:Semisopochnoi.png:
Camera model <span class="plainlinks"><nowiki></nowiki></span>
Interestingly all the fields are rendered even though many are empty, including this one. The nowiki tags link to https://en.wikipedia.org/wiki/Special:Search?search=
Change #1306431 had a related patch set uploaded (by HakanIST; author: HakanIST):
[mediawiki/core@master] FormatMetadata: Fix double-escaping of lang-typed metadata values