diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-07-20 02:18:32 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-20 02:18:32 -0300 |
commit | b8d7bcf93ec21688ad2c7ea3d2d9b591de1b04d1 (patch) | |
tree | 0ce38669c5790105aa5b7617486d9a5b5125de3d /actionview/lib | |
parent | c9061254de48437924293ef0e797365527107dc1 (diff) | |
parent | ef89331f0a397bc88d6e27480aa7562db70550f7 (diff) | |
download | rails-b8d7bcf93ec21688ad2c7ea3d2d9b591de1b04d1.tar.gz rails-b8d7bcf93ec21688ad2c7ea3d2d9b591de1b04d1.tar.bz2 rails-b8d7bcf93ec21688ad2c7ea3d2d9b591de1b04d1.zip |
Merge pull request #25520 from st0012/fix-current-page
Fix ActionView::Helpers#current_page? with trailing space issue.
Diffstat (limited to 'actionview/lib')
-rw-r--r-- | actionview/lib/action_view/helpers/url_helper.rb | 2 |
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 |