Page MenuHomePhabricator

<span class="plainlinks"><nowiki> in metadata of PNG files
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

span plainlinks exif wut.png (829×582 px, 68 KB)

What should have happened instead?:
No codes

Event Timeline

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.

AlexisJazz renamed this task from <span class="plainlinks"><nowiki> in metadata to <span class="plainlinks"><nowiki> in metadata of PNG files.Jun 15 2026, 2:34 PM

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

https://gerrit.wikimedia.org/r/1306431