aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-12-02 15:17:08 -0600
committerJoshua Peek <josh@joshpeek.com>2009-12-02 15:17:08 -0600
commit856d2fd874d72dd9f83204affff4edfef3308361 (patch)
treed05fc8ae5f5f015c2e2fa4b85bfdd730f0eea851
parent1ee9b40b18a0bed5bb10a0785f7e2730bac983f6 (diff)
downloadrails-856d2fd874d72dd9f83204affff4edfef3308361.tar.gz
rails-856d2fd874d72dd9f83204affff4edfef3308361.tar.bz2
rails-856d2fd874d72dd9f83204affff4edfef3308361.zip
Quick fix for not escaping []s (not ideal)
-rw-r--r--activesupport/lib/active_support/core_ext/object/to_query.rb2
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