diff options
author | Douwe Maan <douwe@gitlab.com> | 2019-07-25 20:23:50 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2019-07-25 20:23:50 +0300 |
commit | 9eea3623fa9d59d76f08250947b876abeff89810 (patch) | |
tree | 56bf56afe668ac0135014a865dcdf8829f84796e /lib/gitlab | |
parent | 32be68af8ac7d9bfb07568b5cd9b1d7cc17ac12e (diff) | |
parent | d4ef3be35b63f3ef022e21d6ba56ffe41b8f192c (diff) |
Merge branch 'frozen_string_spec_support' into 'master'
Add frozen_string_literal to spec/support
See merge request gitlab-org/gitlab-ce!31132
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/auth/o_auth/auth_hash.rb | 3 | ||||
-rw-r--r-- | lib/gitlab/utils.rb | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/lib/gitlab/auth/o_auth/auth_hash.rb b/lib/gitlab/auth/o_auth/auth_hash.rb index 72a187377d0..91b9ddc0d00 100644 --- a/lib/gitlab/auth/o_auth/auth_hash.rb +++ b/lib/gitlab/auth/o_auth/auth_hash.rb @@ -60,8 +60,7 @@ module Gitlab def get_info(key) value = info[key] - Gitlab::Utils.force_utf8(value) if value - value + value.is_a?(String) ? Gitlab::Utils.force_utf8(value) : value end def username_and_email diff --git a/lib/gitlab/utils.rb b/lib/gitlab/utils.rb index 31c9e18c996..c66ce0434a4 100644 --- a/lib/gitlab/utils.rb +++ b/lib/gitlab/utils.rb @@ -22,7 +22,7 @@ module Gitlab end def force_utf8(str) - str.force_encoding(Encoding::UTF_8) + str.dup.force_encoding(Encoding::UTF_8) end def ensure_utf8_size(str, bytes:) |