diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-07-19 18:22:58 -0500 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-07-19 18:22:58 -0500 |
commit | 9b7e4018b085dc70d9261173a64e167e0166c94b (patch) | |
tree | 618e0dce0df6622482b427bc5538dc80997c9214 | |
parent | dc32d286bd461447ea09cdb5313d86a3e7bbbdb8 (diff) |
don't strip valueless query strings
-rw-r--r-- | app/helpers/url_helper.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/helpers/url_helper.rb b/app/helpers/url_helper.rb index dd1cf264c..98b532d7f 100644 --- a/app/helpers/url_helper.rb +++ b/app/helpers/url_helper.rb @@ -3,6 +3,7 @@ module UrlHelper return if url.blank? url = Addressable::URI.parse(url) return url.to_s if url.query.blank? + return unless '='.in?(url.query) params = CGI.parse(url.query) params.delete_if do |key| k = key.downcase @@ -29,7 +30,7 @@ module UrlHelper ].include?(k) false end - url.query = URI.encode_www_form(params) + url.query = params.to_query return url.to_s rescue Addressable::URI::InvalidURIError, IDN::Idna::IdnaError return '#' |