aaronpk / Slack-IRC-Gateway

Bridge Slack rooms to IRC channels
Other
34 stars 6 forks source link

URL encode file names when building file URLs from Slack #12

Open Zegnat opened 6 years ago

Zegnat commented 6 years ago

Right now the filename is just concatenated with the URL:

var file_url = imgmatch[1] + "&name=" + data.file.name;

This can result in URLs with spaces in them, breaking autolinking in IRC clients (including mine) and also in the IndieWeb public logs (example: Screen Shot 2017-12-27 at 12.37.17 PM.png).

data.file.name should be URL encoded.