Skip to content

Commit

Permalink
URI.escape is sensitive about being given strings to escape
Browse files Browse the repository at this point in the history
  • Loading branch information
mpalmer committed Mar 6, 2011
1 parent b48041c commit a19bac8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sinatra/url_for.rb
Expand Up @@ -38,7 +38,7 @@ def url_for url_fragment, mode=nil, options = nil
optstring = nil

if options.is_a? Hash
optstring = '?' + options.map { |k,v| "#{k}=#{URI.escape(v, /[^#{URI::PATTERN::UNRESERVED}]/)}" }.join('&')
optstring = '?' + options.map { |k,v| "#{k}=#{URI.escape(v.to_s, /[^#{URI::PATTERN::UNRESERVED}]/)}" }.join('&')
end

case mode
Expand Down

0 comments on commit a19bac8

Please sign in to comment.