From 18b70a565ee6e5505a9d23665d5fedc630a4eb91 Mon Sep 17 00:00:00 2001
From: Alex Shulgin <ash@commandprompt.com>
Date: Thu, 7 Jul 2011 08:47:33 +0300
Subject: [PATCH] Fixed setting issue attributes by mail (use only the first match.)
 Fixes #8758.

---
 app/models/mail_handler.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb
index a312301..f713250 100644
--- a/app/models/mail_handler.rb
+++ b/app/models/mail_handler.rb
@@ -246,7 +246,7 @@ class MailHandler < ActionMailer::Base
     keys.reject! {|k| k.blank?}
     keys.collect! {|k| Regexp.escape(k)}
     format ||= '.+'
-    text.gsub!(/^(#{keys.join('|')})[ \t]*:[ \t]*(#{format})\s*$/i, '')
+    text.sub!(/^(#{keys.join('|')})[ \t]*:[ \t]*(#{format})\s*$/i, '')
     $2 && $2.strip
   end
 
-- 
1.7.4.1

