Merge branch 'rs-remove-username-from-sanitize-attrs' into 'master'

Remove `username` from `User#sanitize_attrs` callback

See merge request !13511
This commit is contained in:
Rémy Coutable 2017-08-14 16:35:14 +00:00
commit be22bf5c73

View file

@ -726,9 +726,9 @@ class User < ActiveRecord::Base
end
def sanitize_attrs
%w[username skype linkedin twitter].each do |attr|
value = public_send(attr) # rubocop:disable GitlabSecurity/PublicSend
public_send("#{attr}=", Sanitize.clean(value)) if value.present? # rubocop:disable GitlabSecurity/PublicSend
%i[skype linkedin twitter].each do |attr|
value = self[attr]
self[attr] = Sanitize.clean(value) if value.present?
end
end