Page MenuHomePhabricator

Ampersand in category selection in UploadWizard shows as & when the category has subdirectories
Open, Needs TriagePublicBUG REPORT

Description

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

  • Upload something using UploadWizard
  • Find a category for it that contains an ampersand

What happens?:

ampersand category 20260711.png (317×368 px, 33 KB)

What should have happened instead?:
&

Other information (browser name/version, screenshots, etc.):
If the category has no subcategories (like https://commons.wikimedia.org/wiki/Category:Vroom_%26_Dreesmann_(Leeuwarden) ) the ampersand renders correctly.

Maybe a superfluous htmlspecialchars() somewhere?

(maybe this is a "good first task"? I'm not sure, someone else may decide)

Event Timeline

AlexisJazz renamed this task from Ampersand in category names in category selection in UploadWizard is sometimes shown as & to Ampersand in category selection in UploadWizard shows as & when the category has subdirectories.Sat, Jul 11, 7:45 AM
AlexisJazz updated the task description. (Show Details)

Change #1309763 had a related patch set uploaded (by Gkm563; author: Gkm563):

[mediawiki/extensions/UploadWizard@master] Fix ampersand rendering in category navigation

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

Gkm563 subscribed.

I investigated this issue and submitted a proposed fix to Gerrit.

The patch addresses the double HTML escaping in the category selection UI and adds a regression test.

https://gerrit.wikimedia.org/r/c/mediawiki/extensions/UploadWizard/+/1309763