Closed onkobu closed 5 years ago
myMPD supports only alphanumeric characters in playlist for security reasons. I look how I can support all UTF-8 characters without compromising security.
Is this something caused by sanitizing input a bit too restrictive, a regular expression with a-zA-Z0-9? Then simply add äöüÄÖÜß in the character class. And I didn't check if the backend also rejects magic characters, so maybe this affects front- and backend?
The filenames are also checked in the backend. The frontend checks are only for better usability, not for safety. Adding only special german characters to the allowed character list don't solves the problem at all. I think a blacklist approach could be better in this case. I will look in the mpd source, how there the filenames are restricted and migrate this approach to myMPD.
checked mpd disallows only \r, \n and / characters in playlist names.
Fix is now in devel. I close this issue.
There is an issue with that in function saveQueue, variable from does no longer exist but is used to call validate_plname. This ought to be var a instead (result of document.getElementById…"saveQueueName").value). Fixing this makes it work like a charm. Keeping it as is makes saving any playlist impossible: undefined variable from.
In addition the new subdir-feature to create the URLs/ basename is a great feature, esp. when proxying.
Bug confirmed, will be fixend in next release
When saving a playlist with a name that contains Umlauts first a JavaScript alert appears with the Umlaut. After clicking OK it disappears and the file name is annotated with »Invalid Filename«.
Nevertheless I can create the playlist by replacing for example ö with oe (Hörspiel -> Hoerspiel), then change to mpd's playlist-directory, rename the m3u-file to contain ö again and use/ edit/ browse it happily in myMPD.
To Reproduce
Expected behavior Playlist is saved no matter what (regular UTF-8) characters are put in.
Desktop (please complete the following information):