Skip to content

Update ampersand URL handling to ensure "A & B" becomes "A-and-B"#1620

Merged
w8tcha merged 1 commit into
masterfrom
fix/ampersand
Mar 16, 2026
Merged

Update ampersand URL handling to ensure "A & B" becomes "A-and-B"#1620
w8tcha merged 1 commit into
masterfrom
fix/ampersand

Conversation

@mt0321

@mt0321 mt0321 commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

Previously, in a forum name, "A & B" would become "AandB". The update to UrlRewriteHelper.CleanStringForUrl() addresses that.

Previously, in a topic name, "A & B" would become "A--amp--B" because the topic name was being double-encoded, first in LinkBuilder.GetTopicLink/GetMessageLink functions (to "A & B"), and then again by UrlRewriteHelper.CleanStringForUrl() when called from LinkBuilder.GetLink(). Removing the first encoding is safe because all paths still call CleanStringForUrl().

Note: "A&B" becomes "A-B", same as before this change.

…becomes "A-and-B"

Previously, in a forum name, "A & B" would become "AandB". The update to UrlRewriteHelper.CleanStringForUrl() addresses that.

Previously, in a topic name, "A & B" would become "A--amp--B" because the topic name was being double-encoded, first in LinkBuilder.GetTopicLink/GetMessageLink functions (to "A & B"), and then again by UrlRewriteHelper.CleanStringForUrl() when called from LinkBuilder.GetLink(). Removing the first encoding is safe because all paths still call CleanStringForUrl().

Note: "A&B" becomes "A-B", same as before this change.
@w8tcha w8tcha added this to the 4.0.3 milestone Mar 16, 2026
@w8tcha
w8tcha merged commit fbc0c7d into master Mar 16, 2026
@mt0321
mt0321 deleted the fix/ampersand branch March 16, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants