[Rt-commit] rt branch, 4.2/improve-subject-parsing, created. rt-4.0.0rc7-248-gc942cf9

Shawn Moore sartak at bestpractical.com
Tue Apr 26 14:58:13 EDT 2011


The branch, 4.2/improve-subject-parsing has been created
        at  c942cf92df4d309b5a21a1b69df61a91b0e55d19 (commit)

- Log -----------------------------------------------------------------
commit c942cf92df4d309b5a21a1b69df61a91b0e55d19
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Apr 26 14:56:02 2011 -0400

    Use a match instead of a substitution
    
        We don't use $Subject in the rest of this tiny function, so we
        certainly don't need to modify it.

diff --git a/lib/RT/Interface/Email.pm b/lib/RT/Interface/Email.pm
index 3561805..6b74460 100644
--- a/lib/RT/Interface/Email.pm
+++ b/lib/RT/Interface/Email.pm
@@ -1191,11 +1191,11 @@ sub ParseTicketId {
     my $test_name = RT->Config->Get('EmailSubjectTagRegex') || qr/\Q$rtname\E/i;
 
     my $id;
-    if ( $Subject =~ s/\[$test_name\s+\#(\d+)\s*\]//i ) {
+    if ( $Subject =~ /\[$test_name\s+\#(\d+)\s*\]/i ) {
         $id = $1;
     } else {
         foreach my $tag ( RT->System->SubjectTag ) {
-            next unless $Subject =~ s/\[\Q$tag\E\s+\#(\d+)\s*\]//i;
+            next unless $Subject =~ /\[\Q$tag\E\s+\#(\d+)\s*\]/i;
             $id = $1;
             last;
         }

-----------------------------------------------------------------------


More information about the Rt-commit mailing list