From f02f238d52f061ee386438fb8bbe14b379e41f42 Mon Sep 17 00:00:00 2001 From: "http://jneen.net/" Date: Tue, 13 Dec 2016 12:14:38 -0800 Subject: Revert "allow empty-quotes" This reverts commit 4f2f678aff8d7dfcac96c47cf7eb480a5707ddaf. --- lib/gitlab/email/reply_parser.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') 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 -- cgit v1.2.1