This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly escape uploaded image names
As reported in #156, we weren't escaping image names containing plus signs. URI.escape('a + b') will produce 'a%20+%20b' which is treated by the browser as 'a b'. We need something that escapes plus signs as well, just like encodeURIComponent does on the javascript side of things. I'm surprised there's nothing better than having to pass a regexp to URI.escape in Ruby, but that seems to be how things are done [1]. We need tests around this, but I'll punt on that until we have things converted to js. [1] http://stackoverflow.com/questions/2834034/how-do-i-raw-url-encode-decode-in-javascript-and-ruby-to-get-the-same-values-in-b
- Loading branch information
f03b5be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth writing a pending spec, so that we don't forget to test it later.
f03b5be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, thanks for fixing this!