sudara / alonetone

A free, open source, non-commercial home for musicians and their music
https://alonetone.com
MIT License
346 stars 89 forks source link

Be more conservative with slug generation, handle brackets, quotes, parens #1175

Open sudara opened 2 years ago

sudara commented 2 years ago

https://forum.alonetone.com/t/possible-issues-with-the-song-page-song-mp3-url/78

Maybe best to swallow/replace all considered "unsafe":

RFC1738 https://www.ietf.org/rfc/rfc1738.txt

Characters can be unsafe for a number of reasons. The space character is unsafe because significant spaces may disappear and insignificant spaces may be introduced when URLs are transcribed or typeset or subjected to the treatment of word-processing programs. The characters "<" and ">" are unsafe because they are used as the delimiters around URLs in free text; the quote mark (""") is used to delimit URLs in some systems. The character "#" is unsafe and should always be encoded because it is used in World Wide Web and in other systems to delimit a URL from a fragment/anchor identifier that might follow it. The character "%" is unsafe because it is used for encodings of other characters. Other characters are unsafe because gateways and other transport agents are known to sometimes modify such characters. These characters are "{", "}", "|", "\", "^", "~", "[", "]", and "`".