about summary refs log tree commit diff
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-07-19 18:22:58 -0500
committermultiple creatures <dev@multiple-creature.party>2019-07-19 18:22:58 -0500
commit9b7e4018b085dc70d9261173a64e167e0166c94b (patch)
tree618e0dce0df6622482b427bc5538dc80997c9214
parentdc32d286bd461447ea09cdb5313d86a3e7bbbdb8 (diff)
don't strip valueless query strings
-rw-r--r--app/helpers/url_helper.rb3
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 '#'