aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/url_helper.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-08-01 17:59:25 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-08-01 17:59:25 -0300
commitb3c0858f732da157195ad3e2dec470791c754cfe (patch)
tree5e01e18c660765441745477988c4f68decd78df5 /actionview/lib/action_view/helpers/url_helper.rb
parent4b87854e541a47a485bb3b34dc6d090a48b8cc9c (diff)
downloadrails-b3c0858f732da157195ad3e2dec470791c754cfe.tar.gz
rails-b3c0858f732da157195ad3e2dec470791c754cfe.tar.bz2
rails-b3c0858f732da157195ad3e2dec470791c754cfe.zip
Make current_page? compare binary strings
Diffstat (limited to 'actionview/lib/action_view/helpers/url_helper.rb')
-rw-r--r--actionview/lib/action_view/helpers/url_helper.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/actionview/lib/action_view/helpers/url_helper.rb b/actionview/lib/action_view/helpers/url_helper.rb
index 6bfcfad60a..db0fb40336 100644
--- a/actionview/lib/action_view/helpers/url_helper.rb
+++ b/actionview/lib/action_view/helpers/url_helper.rb
@@ -528,17 +528,18 @@ module ActionView
return false unless request.get? || request.head?
- url_string = url_for(options)
+ url_string = URI.unescape(url_for(options)).force_encoding(Encoding::BINARY)
# We ignore any extra parameters in the request_uri if the
# submitted url doesn't have any either. This lets the function
# work with things like ?order=asc
request_uri = url_string.index("?") ? request.fullpath : request.path
+ request_uri = URI.unescape(request_uri).force_encoding(Encoding::BINARY)
if url_string =~ /^\w+:\/\//
- URI.unescape(url_string) == URI.unescape("#{request.protocol}#{request.host_with_port}#{request_uri}")
+ url_string == "#{request.protocol}#{request.host_with_port}#{request_uri}"
else
- URI.unescape(url_string) == URI.unescape(request_uri)
+ url_string == request_uri
end
end