Page MenuHomePhabricator

Gallery/slideshow display formats won't show image with apostrophe in filename
Closed, ResolvedPublicBUG REPORT

Description

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

  • Create a Cargo query that returns a File field.

What happens?:

  • Works fine for all other formats checked but does not work for format=gallery or format=slideshow/
  • In those cases it tries to use %26#039; instead of ' (maybe encoded too much, via '?)

What should have happened instead?:

  • Should show the image, as it does for filenames without '.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

  • MediaWiki 1.43.6
  • Cargo 3.9

Event Timeline

Change #1308692 had a related patch set uploaded (by Shubhita6; author: Shubhita6):

[mediawiki/extensions/Cargo@master] Decode HTML entities in image filename for Gallery, Slideshow and Zip formats

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

Shubhita6 added a project: RoadToWiki.
Shubhita6 subscribed.

I have uploaded a patch to resolve this issue by decoding HTML entities in the file name string using htmlspecialchars_decode before passing it to Title::makeTitleSafe or Title::newFromText. This fixes image resolution for filenames containing apostrophes (or other special characters) when using format=gallery, format=slideshow, or format=zip.

Patch for review: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Cargo/+/1308692

Change #1308692 merged by jenkins-bot:

[mediawiki/extensions/Cargo@master] Decode HTML entities in image filename for Gallery, Slideshow and Zip formats

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

I can confirm that the latest Cargo code fixes this problem for me. Thank you.