From c75dba701d446c62653a43e147e515aa4fb00d44 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 7 Dec 2021 12:07:48 +0100 Subject: [PATCH] lib: replace URI.encode by CGI.escape URI.encode was removed in Ruby 3. Fix an error when adding a phone number to a Helpscout ticket. --- app/lib/helpscout/api.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/helpscout/api.rb b/app/lib/helpscout/api.rb index 127002854..c0538c7a9 100644 --- a/app/lib/helpscout/api.rb +++ b/app/lib/helpscout/api.rb @@ -43,7 +43,7 @@ class Helpscout::API end def add_phone_number(email, phone) - query = URI.encode("(email:#{email})") + query = CGI.escape("(email:#{email})") response = call_api(:get, "#{CUSTOMERS}?mailbox=#{user_support_mailbox_id}&query=#{query}") if response.success? body = parse_response_body(response)