Skip to content

Do not disallow question marks and other chars in URLs#349

Merged
don-vip merged 1 commit intomasterfrom
fix/simplify-title-rules
Mar 30, 2026
Merged

Do not disallow question marks and other chars in URLs#349
don-vip merged 1 commit intomasterfrom
fix/simplify-title-rules

Conversation

@Amdrel
Copy link
Copy Markdown
Collaborator

@Amdrel Amdrel commented Mar 30, 2026

The title sanitization rules are too strict and disallow valid titles. It's possible these rules used to make sense, but the rules have since been changed. This patch isn't exhaustive and other rules may need to be amended.

The new pattern has been adjusted to:

  • Allow '?' and '+' in the title as those are allowed on Commons
  • No longer check '\u0000-\u001f' and '\u007f' as those are already covered by earlier rules and are redundant
  • No longer check for '#', ':', and '/' as those are covered by other rules, though I'm unsure if those rules are even needed

The title sanitization rules are too strict and disallow valid titles.
It's possible the rules used to apply but the rules have since been
changed. This patch isn't exhaustive and other rules may need to be
amended.

The new pattern has been adjusted to:

* Allow '?' and '+' in the title as those are allowed on Commons

* No longer check '\u0000-\u001f' and '\u007f' as those are already
  covered by earlier rules and are redundant

* No longer check for '#', ':', and '/' as those are covered by other
  rules, though I'm unsure if those rules are even needed
@Amdrel Amdrel requested a review from don-vip March 30, 2026 19:29
@don-vip
Copy link
Copy Markdown
Collaborator

don-vip commented Mar 30, 2026

I think we will start to need unit tests for this kind of checks :)

@don-vip don-vip merged commit f9e31a6 into master Mar 30, 2026
5 checks passed
@Amdrel
Copy link
Copy Markdown
Collaborator Author

Amdrel commented Mar 30, 2026

Those would be nice to have for a few things

@don-vip don-vip deleted the fix/simplify-title-rules branch March 31, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants