Skip to content

Commit

Permalink
Quick fix for not escaping []s (not ideal)
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Dec 2, 2009
1 parent 1ee9b40 commit 856d2fd
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -7,7 +7,7 @@ class Object
# Note: This method is defined as a default implementation for all Objects for Hash#to_query to work.
def to_query(key)
require 'cgi' unless defined?(CGI) && defined?(CGI::escape)
"#{CGI.escape(key.to_s)}=#{CGI.escape(to_param.to_s)}"
"#{CGI.escape(key.to_s).gsub(/%(5B|5D)/n) { [$1].pack('H*') }}=#{CGI.escape(to_param.to_s)}"
end
end

Expand Down

0 comments on commit 856d2fd

Please sign in to comment.