diff options
author | http://jneen.net/ <jneen@jneen.net> | 2016-12-13 12:14:38 -0800 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2016-12-21 09:51:42 -0800 |
commit | f02f238d52f061ee386438fb8bbe14b379e41f42 (patch) | |
tree | 67741437ba5387f4351c8a1d14de6ee6894adb95 /lib/gitlab/email/reply_parser.rb | |
parent | 56031276993347a7fba542c67c640fdae79df716 (diff) | |
download | gitlab-ce-f02f238d52f061ee386438fb8bbe14b379e41f42.tar.gz |
Revert "allow empty-quotes"
This reverts commit 4f2f678aff8d7dfcac96c47cf7eb480a5707ddaf.
Diffstat (limited to 'lib/gitlab/email/reply_parser.rb')
-rw-r--r-- | lib/gitlab/email/reply_parser.rb | 4 |
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 |