[vhffs-dev] [1138] filter separators in input (accept mails with space and tab arround)

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1138
Author:   gradator
Date:     2008-01-23 19:28:35 +0000 (Wed, 23 Jan 2008)

Log Message:
-----------
filter separators in input (accept mails with space and tab arround)

Modified Paths:
--------------
    trunk/vhffs-panel/mailinglist/prefs.pl


Modified: trunk/vhffs-panel/mailinglist/prefs.pl
===================================================================
--- trunk/vhffs-panel/mailinglist/prefs.pl	2008-01-20 20:05:58 UTC (rev 1137)
+++ trunk/vhffs-panel/mailinglist/prefs.pl	2008-01-23 19:28:35 UTC (rev 1138)
@@ -287,19 +287,19 @@
 
     foreach my $member ( @members )  {
         chomp $member;
-
+	( $member ) = ( $member =~ /^\s*([^\s]+)\s*$/ );
         if( ! Vhffs::Functions::valid_mail( $member ) )  {
-            $panel->add_error( sprintf( gettext('%s is not a valid mail'), $member ) )
+       	    $panel->add_error( sprintf( gettext('%s is not a valid mail'), $member ) )
         }  elsif( $list->add_sub( $member , Vhffs::Constants::ML_RIGHT_SUB )  < 0 ) {
-            $panel->add_error( sprintf( gettext( '%s is already a member of this list' ), $member ) );
+       	    $panel->add_error( sprintf( gettext( '%s is already a member of this list' ), $member ) );
         } else {
-            $panel->add_info( sprintf( gettext( '%s has been added' ), $member ) );
+       	    $panel->add_info( sprintf( gettext( '%s has been added' ), $member ) );
             Vhffs::Functions::send_mail(
-                $listengineconfig->{'listmaster'},
+       	        $listengineconfig->{'listmaster'},
                 $member,
-                undef,
+       	        undef,
                 sprintf(gettext('[%s] You\'ve been added to the list %s'), $list->get_prefix, $list->get_localpart.'@'.$list->get_domain),
-                sprintf(gettext("Greetings,\n\nYou've been added to the list %s on platform %s.\n\nYou may get some help on listengine by sending an email to %s-request\@%s with subject help.\n\nCheers."), $list->get_localpart.'@'.$list->get_domain, $vhffs->get_config->get_host_name, $list->get_localpart, $list->get_domain),
+       	        sprintf(gettext("Greetings,\n\nYou've been added to the list %s on platform %s.\n\nYou may get some help on listengine by sending an email to %s-request\@%s with subject help.\n\nCheers."), $list->get_localpart.'@'.$list->get_domain, $vhffs->get_config->get_host_name, $list->get_localpart, $list->get_domain),
                 );
         }
     }


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/