Permalink
Browse files

URI.escape is sensitive about being given strings to escape

  • Loading branch information...
1 parent b48041c commit a19bac86311029a2bb6c7df940cc905686adc9cd @mpalmer mpalmer committed Mar 6, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/sinatra/url_for.rb
View
@@ -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

0 comments on commit a19bac8

Please sign in to comment.