Skip to content

Commit

Permalink
Fix warnings raised by URI 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jrafanie committed Nov 8, 2024
1 parent 3fada58 commit f1e35b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/helpers/application_helper/toolbar_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -412,15 +412,15 @@ def update_url_parms(url_parm)

url_parm_hash = preprocess_url_param(url_parm)
query_string.merge!(url_parm_hash)
URI::DEFAULT_PARSER.unescape("?#{query_string.to_query}")
URI::RFC2396_PARSER.unescape("?#{query_string.to_query}")
end

def preprocess_url_param(url_parm)
parse_questionmark = /^\?/.match(url_parm)
parse_ampersand = /^&/.match(url_parm)
url_parm = parse_questionmark.post_match if parse_questionmark.present?
url_parm = parse_ampersand.post_match if parse_ampersand.present?
encoded_url = URI::DEFAULT_PARSER.escape(url_parm)
encoded_url = URI::RFC2396_PARSER.escape(url_parm)
Rack::Utils.parse_query(URI("?#{encoded_url}").query)
end

Expand Down

0 comments on commit f1e35b0

Please sign in to comment.