Page MenuHomePhabricator

do not use Reserved Characters for short URLs
Closed, DuplicatePublicFeature

Description

The UrlShortener creates short links containing Reserved Characters ( https://datatracker.ietf.org/doc/html/rfc3986#section-2.2 ) like this: https://w.wiki/7YP$

Reserved Characters in links might break them if you don't encode them. Example: https://mastodon.social/@Ustinoff/111121931897969987

It would have been better not to use the reserved characters at all from the beginning. It would be good if they were not used to create short URLs in the future.

It would be possibel to percent-encode the short URL, but that would make the short URL longer, which defeats its purpose. Example from above: https://w.wiki/7YP%24

Event Timeline

The character set has been changed in the past, but these are all before the extension is deployed on Wikimedia. Now that it's deployed, changing the set is practically infeasible.

As you can see, Phabricator handles it well here https://w.wiki/7YP$, it also works on wiki and possibly elsewhere. The solution is to encode it if the character appears (only two additional chars, not much). On some platforms using angle brackets (less-than and greater-than chars actually) may help.