1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #11735 from arunagw/av-warning-removed-master

Using URI.parser.unescape
This commit is contained in:
Yves Senn 2013-08-03 07:02:50 -07:00
commit 51c61cfbc8

View file

@ -528,13 +528,13 @@ module ActionView
return false unless request.get? || request.head?
url_string = URI.unescape(url_for(options)).force_encoding(Encoding::BINARY)
url_string = URI.parser.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)
request_uri = URI.parser.unescape(request_uri).force_encoding(Encoding::BINARY)
if url_string =~ /^\w+:\/\//
url_string == "#{request.protocol}#{request.host_with_port}#{request_uri}"