From bc1cf91c3eee2d756ea56b564d5c363e286984d4 Mon Sep 17 00:00:00 2001 From: Joseph Mondragon Date: Thu, 22 Dec 2022 10:50:09 -0600 Subject: [PATCH] fix encode bug, replace with CGI.escape --- lib/resque_cleaner/server.rb | 2 +- lib/resque_cleaner/server/views/_stats.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/resque_cleaner/server.rb b/lib/resque_cleaner/server.rb index 855b485..19fead0 100644 --- a/lib/resque_cleaner/server.rb +++ b/lib/resque_cleaner/server.rb @@ -230,7 +230,7 @@ def build_urls f: @from, t: @to, regex: @regex - }.map {|key,value| "#{key}=#{URI.encode(value.to_s)}"}.join("&") + }.map {|key,value| "#{key}=#{CGI.escape(value.to_s)}"}.join("&") @list_url = "cleaner_list?#{params}" @dump_url = "cleaner_dump?#{params}" diff --git a/lib/resque_cleaner/server/views/_stats.erb b/lib/resque_cleaner/server/views/_stats.erb index 05bafb7..ee451f3 100644 --- a/lib/resque_cleaner/server/views/_stats.erb +++ b/lib/resque_cleaner/server/views/_stats.erb @@ -10,7 +10,7 @@ <% @stats[type.to_sym].each do |field,count| %> - <% filter = "#{q}=#{URI.encode(field)}" %> + <% filter = "#{q}=#{CGI.escape(field)}" %> <%= field %> <%= count[:total] %>