summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-06-30 11:43:14 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-30 11:43:21 +0000
commit16fa5cf183d9f59a66c1e258ce36cd3f09c8d3fd (patch)
treeb1662c1ee4766bba9d71cf2dc06204ab281a4d11 /app/models
parent33e4d44c11427a31ada41e7a0757d35f03d62ce7 (diff)
downloadgitlab-ce-16fa5cf183d9f59a66c1e258ce36cd3f09c8d3fd.tar.gz
Add latest changes from gitlab-org/security/gitlab@14-0-stable-ee
Diffstat (limited to 'app/models')
-rw-r--r--app/models/user.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 5fbd6271589..3879eb51371 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1257,12 +1257,23 @@ class User < ApplicationRecord
end
def sanitize_attrs
+ sanitize_links
+ sanitize_name
+ end
+
+ def sanitize_links
%i[skype linkedin twitter].each do |attr|
value = self[attr]
self[attr] = Sanitize.clean(value) if value.present?
end
end
+ def sanitize_name
+ return unless self.name
+
+ self.name = self.name.gsub(%r{</?[^>]*>}, '')
+ end
+
def set_notification_email
if notification_email.blank? || all_emails.exclude?(notification_email)
self.notification_email = email