wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r16336: LJSUP-5468

Committer: gprochaev
LJSUP-5468

U   trunk/cgi-bin/sysban.pl
Modified: trunk/cgi-bin/sysban.pl
===================================================================
--- trunk/cgi-bin/sysban.pl	2010-03-04 11:13:25 UTC (rev 16335)
+++ trunk/cgi-bin/sysban.pl	2010-03-04 12:32:34 UTC (rev 16336)
@@ -151,9 +151,18 @@
 
         # see if this domain is banned
         my @domains = split(/\./, $1);
-        return 0 unless scalar @domains >= 2;
-        return 1 if $check->('email_domain', "$domains[-2].$domains[-1]");
+        
+        ## invalid domain of e-mail address
+        return 1 if @domains<2;
 
+        ## for email like 'name@abc.def.ghi.klm',
+        ## check 'ghi.klm', 'def.ghi.klm' and 'abc.def.ghi.klm' domains
+        my $checking_domain = pop @domains;
+        while (@domains) {
+            $checking_domain = pop(@domains) . "." . $checking_domain;
+            return 1 if $check->('email_domain', $checking_domain);
+        }
+
         # must not be banned
         return 0;
     }

Tags: livejournal, pl, wisest-owl
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments