lib/ronin/extensions/uri/query_params.rb in ronin-0.2.2 vs lib/ronin/extensions/uri/query_params.rb in ronin-0.2.3
- old
+ new
@@ -19,10 +19,12 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#++
#
+require 'cgi'
+
module URI
module QueryParams
# Query parameters
attr_accessor :query_params
@@ -87,12 +89,12 @@
str += '?' + @query_params.to_a.map { |name,value|
if value==true
"#{name}=active"
elsif value
if value.kind_of?(Array)
- "#{name}=#{URI.encode(value.join(' '))}"
+ "#{name}=#{CGI.escape(value.join(' '))}"
else
- "#{name}=#{URI.encode(value.to_s)}"
+ "#{name}=#{CGI.escape(value.to_s)}"
end
else
"#{name}="
end
}.join('&')