Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhttp://jneen.net/ <jneen@jneen.net>2016-12-13 23:14:38 +0300
committerhttp://jneen.net/ <jneen@jneen.net>2016-12-21 20:51:42 +0300
commitf02f238d52f061ee386438fb8bbe14b379e41f42 (patch)
tree67741437ba5387f4351c8a1d14de6ee6894adb95 /lib/gitlab/email
parent56031276993347a7fba542c67c640fdae79df716 (diff)
Revert "allow empty-quotes"
This reverts commit 4f2f678aff8d7dfcac96c47cf7eb480a5707ddaf.
Diffstat (limited to 'lib/gitlab/email')
-rw-r--r--lib/gitlab/email/reply_parser.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/email/reply_parser.rb b/lib/gitlab/email/reply_parser.rb
index 96d0a4f5153..971afe4a878 100644
--- a/lib/gitlab/email/reply_parser.rb
+++ b/lib/gitlab/email/reply_parser.rb
@@ -18,6 +18,10 @@ module Gitlab
# not using /\s+$/ here because that deletes empty lines
body = body.gsub(/[ \t]$/, '')
+ # TODO [jneen]: do we want to allow empty-quoting? (replies only containing a blockquote)
+ # EmailReplyTrimmer allows this as a special case, so we detect it manually here.
+ return "" if body.lines.all? { |l| l.strip.empty? || l.start_with?('>') }
+
body.force_encoding(encoding).encode("UTF-8")
end