[Rt-commit] r14956 - rt/3.8/trunk/lib/RT/Interface

ruz at bestpractical.com ruz at bestpractical.com
Sat Aug 9 16:22:44 EDT 2008


Author: ruz
Date: Sat Aug  9 16:22:43 2008
New Revision: 14956

Modified:
   rt/3.8/trunk/lib/RT/Interface/Email.pm

Log:
* localize loop's variable instead of using $_, an user reported
  that some email plugins can corrupt it... I didn't find proof,
  but that's pretty easy to avoid problem then let it sit there

Modified: rt/3.8/trunk/lib/RT/Interface/Email.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Interface/Email.pm	(original)
+++ rt/3.8/trunk/lib/RT/Interface/Email.pm	Sat Aug  9 16:22:43 2008
@@ -1094,11 +1094,11 @@
     my @mail_plugins = @_;
 
     my @res;
-    foreach (@mail_plugins) {
-        if ( ref($_) eq "CODE" ) {
-            push @res, $_;
-        } elsif ( !ref $_ ) {
-            my $Class = $_;
+    foreach my $plugin (@mail_plugins) {
+        if ( ref($plugin) eq "CODE" ) {
+            push @res, $plugin;
+        } elsif ( !ref $plugin ) {
+            my $Class = $plugin;
             $Class = "RT::Interface::Email::" . $Class
                 unless $Class =~ /^RT::Interface::Email::/;
             $Class->require or
@@ -1111,7 +1111,7 @@
             }
             push @res, $Class;
         } else {
-            $RT::Logger->crit( "$_ - is not class name or code reference");
+            $RT::Logger->crit( "$plugin - is not class name or code reference");
         }
     }
     return @res;


More information about the Rt-commit mailing list