Escape entries in directory listings
This commit is contained in:
parent
3821d4a055
commit
bf00b2a352
@ -130,7 +130,8 @@ module RemoteStorage
|
||||
|
||||
directory_entries(user, directory).each do |entry|
|
||||
timestamp = DateTime.rfc2822(entry["last_modified"]).to_i
|
||||
listing.merge!({ CGI.unescape(entry["name"]) => timestamp })
|
||||
entry_name = CGI.unescape(entry["name"])
|
||||
listing.merge!({ CGI.escape(entry_name) => timestamp })
|
||||
end
|
||||
|
||||
listing
|
||||
|
@ -28,7 +28,7 @@ describe "Directories" do
|
||||
last_response.content_type.must_equal "application/json"
|
||||
|
||||
content = JSON.parse(last_response.body)
|
||||
content.must_include "http://5apps.com"
|
||||
content.must_include "http%3A%2F%2F5apps.com"
|
||||
content.must_include "foo"
|
||||
content["foo"].must_be_kind_of Integer
|
||||
content["foo"].to_s.must_match /\d+/
|
||||
@ -63,7 +63,7 @@ describe "Directories" do
|
||||
|
||||
content = JSON.parse(last_response.body)
|
||||
content.must_include "foo"
|
||||
content.must_include "http://5apps.com"
|
||||
content.must_include "http%3A%2F%2F5apps.com"
|
||||
content.must_include "home/"
|
||||
content["home/"].must_be_kind_of Integer
|
||||
content["home/"].to_s.must_match /\d+/
|
||||
|
Loading…
x
Reference in New Issue
Block a user