提交 856d2fd8 编写于 作者: J Joshua Peek

Quick fix for not escaping []s (not ideal)

上级 1ee9b40b
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册