Skip to content

Commit

Permalink
Replace obsolete method URI.decode (#3503)
Browse files Browse the repository at this point in the history
`URI.decode` calls `URI.unescape`, which has been removed in Ruby 2.7. 

This commit replaces `URI.decode` with `CGI.unescape`.
  • Loading branch information
RandieM authored Jul 14, 2021
1 parent 2da576f commit a14119d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pages/app/presenters/refinery/pages/menu_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def selected_item?(item)
url = find_url_for(item)

# Now use all possible vectors to try to find a valid match
[path, URI.decode(path)].include?(url) || path == "/#{item.original_id}"
[path, CGI.unescape(path)].include?(url) || path == "/#{item.original_id}"
end

def menu_item_css(menu_item, index)
Expand Down Expand Up @@ -136,4 +136,4 @@ def find_url_for(item)
end
end
end
end
end

0 comments on commit a14119d

Please sign in to comment.