aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/url_helper.rb
diff options
context:
space:
mode:
authorStan Lo <a22301613@yahoo.com.tw>2016-06-25 11:29:39 +0800
committerStan Lo <a22301613@yahoo.com.tw>2016-07-20 10:57:26 +0800
commitef89331f0a397bc88d6e27480aa7562db70550f7 (patch)
treea3ef633cead7494d8e6d567e9bf5d63b867d6cb9 /actionview/lib/action_view/helpers/url_helper.rb
parent40bf7a52d51498879d9b442663b7a23f37fb1204 (diff)
downloadrails-ef89331f0a397bc88d6e27480aa7562db70550f7.tar.gz
rails-ef89331f0a397bc88d6e27480aa7562db70550f7.tar.bz2
rails-ef89331f0a397bc88d6e27480aa7562db70550f7.zip
Fix ActionView::Helpers#current_page? with issue in https://github.com/rails/rails/issues/19472
Diffstat (limited to 'actionview/lib/action_view/helpers/url_helper.rb')
-rw-r--r--actionview/lib/action_view/helpers/url_helper.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/actionview/lib/action_view/helpers/url_helper.rb b/actionview/lib/action_view/helpers/url_helper.rb
index 11c7daf4da..fb6426b997 100644
--- a/actionview/lib/action_view/helpers/url_helper.rb
+++ b/actionview/lib/action_view/helpers/url_helper.rb
@@ -548,6 +548,8 @@ module ActionView
request_uri = url_string.index("?") ? request.fullpath : request.path
request_uri = URI.parser.unescape(request_uri).force_encoding(Encoding::BINARY)
+ url_string.chomp!("/") if url_string.start_with?("/") && url_string != "/"
+
if url_string =~ /^\w+:\/\//
url_string == "#{request.protocol}#{request.host_with_port}#{request_uri}"
else