From ce03092e61f4dfcd574203305b9ab9d72aa83974 Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Thu, 12 Dec 2019 14:54:26 +1000 Subject: [PATCH] Fix DiscourseCops/NoURIEscapeEncode errors and re-enable --- .rubocop.yml | 2 -- lib/twitter_api.rb | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 9a416003ccf..0a15cd98e3c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -140,8 +140,6 @@ DiscourseCops/NoChdir: DiscourseCops/NoURIEscapeEncode: Enabled: true - Exclude: - - 'plugins/**/*' Style/GlobalVars: Enabled: true diff --git a/lib/twitter_api.rb b/lib/twitter_api.rb index b662c433c48..8b9f0887673 100644 --- a/lib/twitter_api.rb +++ b/lib/twitter_api.rb @@ -121,7 +121,7 @@ class TwitterApi def bearer_token_credentials Base64.strict_encode64( - "#{URI::encode(consumer_key)}:#{URI::encode(consumer_secret)}" + "#{UrlHelper.encode_component(consumer_key)}:#{UrlHelper.encode_component(consumer_secret)}" ) end