summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Jankovski <maxlazio@gmail.com>2014-11-14 11:08:58 +0100
committerJacob Vosmaer <contact@jacobvosmaer.nl>2014-11-19 12:25:06 +0100
commit1d53d9c7b1022ce4d2819d7b0937511bd73168e4 (patch)
tree52e88a2b615cc2f545f2b401db256d003a79c539
parent85a9feabd67d6403a59d8aa98f52f83b6bd42fea (diff)
downloadgitlab-ce-1d53d9c7b1022ce4d2819d7b0937511bd73168e4.tar.gz
Clean the string with commit author and email.
-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