summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@gitlab.com>2014-11-14 14:10:03 +0000
committerDmitriy Zaporozhets <dzaporozhets@gitlab.com>2014-11-14 14:10:03 +0000
commita69249d9de54077dd89f896d278444590d7e7407 (patch)
tree0b27e68b592cb70c94109f80e138780e282db0fb
parent7e3f49bab0ea1ecdef685649d973a840663beeed (diff)
parentced2438312c3fd48f9487465533bb493d83ee998 (diff)
downloadgitlab-ce-a69249d9de54077dd89f896d278444590d7e7407.tar.gz
Merge branch 'author_attributes_clean' into 'master'
Author attributes clean See merge request !1254
-rw-r--r--app/helpers/commits_helper.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb
index 0e0532b65b2..36adeadd8a5 100644
--- a/app/helpers/commits_helper.rb
+++ b/app/helpers/commits_helper.rb
@@ -87,8 +87,8 @@ module CommitsHelper
# avatar: true will prepend the avatar image
# size: size of the avatar image in px
def commit_person_link(commit, options = {})
- source_name = commit.send "#{options[:source]}_name".to_sym
- source_email = commit.send "#{options[:source]}_email".to_sym
+ source_name = clean(commit.send "#{options[:source]}_name".to_sym)
+ source_email = clean(commit.send "#{options[:source]}_email".to_sym)
user = User.find_for_commit(source_email, source_name)
person_name = user.nil? ? source_name : user.name
@@ -124,4 +124,8 @@ module CommitsHelper
def truncate_sha(sha)
Commit.truncate_sha(sha)
end
+
+ def clean(string)
+ Sanitize.clean(string, remove_contents: true)
+ end
end