summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-04-14 15:45:06 +0200
committerDouwe Maan <douwe@gitlab.com>2015-04-14 16:32:11 +0200
commit5662b2413206db20f935a0dffb5f12debd248447 (patch)
tree1101ee8fffb97ea5242b440acc0533fc0dca1941
parentbf7932bd06e45f82c7aa80373aa3aa1bf52d4d88 (diff)
downloadgitlab-ce-emailsonpush-hellip.tar.gz
Don't use HTML ellipsis in EmailsOnPush subject truncated commit message.emailsonpush-hellip
-rw-r--r--CHANGELOG1
-rw-r--r--app/models/commit.rb4
-rw-r--r--spec/models/commit_spec.rb2
3 files changed, 4 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 0ecde5ef89c..3f3e8fc3202 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
Please view this file on the master branch, on stable branches it's out of date.
v 7.10.0 (unreleased)
+ - Don't use HTML ellipsis in EmailsOnPush subject truncated commit message.
- Fix broken file browsing with a submodule that contains a relative link (Stan Hu)
- Fix persistent XSS vulnerability around profile website URLs.
- Fix project import URL regex to prevent arbitary local repos from being imported.
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 7a0ad137650..006fa62c8f9 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -77,7 +77,7 @@ class Commit
title_end = title.index("\n")
if (!title_end && title.length > 100) || (title_end && title_end > 100)
- title[0..79] << "&hellip;".html_safe
+ title[0..79] << "…"
else
title.split("\n", 2).first
end
@@ -90,7 +90,7 @@ class Commit
title_end = safe_message.index("\n")
@description ||=
if (!title_end && safe_message.length > 100) || (title_end && title_end > 100)
- "&hellip;".html_safe << safe_message[80..-1]
+ "…" << safe_message[80..-1]
else
safe_message.split("\n", 2)[1].try(:chomp)
end
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb
index 8b3d88640da..11cc7762ce4 100644
--- a/spec/models/commit_spec.rb
+++ b/spec/models/commit_spec.rb
@@ -14,7 +14,7 @@ describe Commit do
message = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales id felis id blandit. Vivamus egestas lacinia lacus, sed rutrum mauris.'
allow(commit).to receive(:safe_message).and_return(message)
- expect(commit.title).to eq("#{message[0..79]}&hellip;")
+ expect(commit.title).to eq("#{message[0..79]}…")
end
it "truncates a message with a newline before 80 characters at the newline" do