Page MenuHomePhabricator

Fragments in redirects returned by action=parse are wrong when they contain an underscore
Open, Needs TriagePublicBUG REPORT

Description

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

What happens?:

fragment value is Crime and law enforcement

What should have happened instead?:

fragment should be Crime_and_law_enforcement

Other information:

It looks like something is transforming the fragment id to something which looks like a title. I see no reason this should be a title, since it is a fragment, hence the id of some HTML element.

But I might miss a good reason to do so.

Event Timeline

Looks like reason for doing so is https://phabricator.wikimedia.org/T285951 but I'm still not convinced this was done the right way. Offending code is in normalizeFragment of includes/titles/Title.php if I'm not mistaken.

Anyway, it is maybe preferable to keep it as is since we anyway have a legacy now, other tools might have build upon this assumption that underscores are replaced by spaces.

E.g. mwoffliner will anyway continue to replace spaces by underscores for years since we have Mediawiki versions in the wild with this code.

HCoplin-WMF subscribed.

Assume this is CTT's domain. Removing MWI tag.