diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-12-02 15:17:08 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-12-02 15:17:08 -0600 |
commit | 856d2fd874d72dd9f83204affff4edfef3308361 (patch) | |
tree | d05fc8ae5f5f015c2e2fa4b85bfdd730f0eea851 /activesupport/lib/active_support/core_ext/object/to_query.rb | |
parent | 1ee9b40b18a0bed5bb10a0785f7e2730bac983f6 (diff) | |
download | rails-856d2fd874d72dd9f83204affff4edfef3308361.tar.gz rails-856d2fd874d72dd9f83204affff4edfef3308361.tar.bz2 rails-856d2fd874d72dd9f83204affff4edfef3308361.zip |
Quick fix for not escaping []s (not ideal)
Diffstat (limited to 'activesupport/lib/active_support/core_ext/object/to_query.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object/to_query.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/to_query.rb b/activesupport/lib/active_support/core_ext/object/to_query.rb index 1c6a02c9ad..c9981895b4 100644 --- a/activesupport/lib/active_support/core_ext/object/to_query.rb +++ b/activesupport/lib/active_support/core_ext/object/to_query.rb @@ -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 |