mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
use CGI.escapeHTML instead of CGI.escape
CGI.escape creates URL-safe encodings, but we need XML-safe encodings. If the key name has a "/" in it (as for a directory structure) it gets replaced with a URL-safe "%2F" which S3 treats as a literal part of the key name. We only need to escape the parts of the key that could result in malformed XML.
This commit is contained in:
parent
666b832232
commit
2c38747fa9
1 changed files with 2 additions and 2 deletions
|
@ -42,10 +42,10 @@ module Fog
|
|||
version_ids = options.delete('versionId')
|
||||
object_names.each do |object_name|
|
||||
data << "<Object>"
|
||||
data << "<Key>#{CGI.escape(object_name)}</Key>"
|
||||
data << "<Key>#{CGI.escapeHTML(object_name)}</Key>"
|
||||
object_version = version_ids.nil? ? nil : version_ids[object_name]
|
||||
if object_version
|
||||
data << "<VersionId>#{CGI.escape(object_version)}</VersionId>"
|
||||
data << "<VersionId>#{CGI.escapeHTML(object_version)}</VersionId>"
|
||||
end
|
||||
data << "</Object>"
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue