Dotclear


Ignore:
Timestamp:
10/26/12 14:16:48 (13 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

enhance links lookup anti spam filter, thanks gnieark, fixes #1152

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/antispam/filters/class.dc.filter.linkslookup.php

    r270 r913  
    4343                    continue; 
    4444               } 
    45                 
    46                $domain = preg_replace('/^(.*\.)([^.]+\.[^.]+)$/','$2',$b['host']); 
    47                $host = $domain.'.'.$this->server; 
    48                 
    49                if (gethostbyname($host) != $host) { 
    50                     $status = substr($domain,0,128); 
    51                     return true; 
    52                } 
     45 
     46               $domain = preg_replace('/^[\w]{2,6}:\/\/([\w\d\.\-]+).*$/','$1',$b['host']); 
     47               $domain_elem = explode(".",$domain); 
     48 
     49               $i = count($domain_elem) - 1; 
     50               $host = $domain_elem[$i]; 
     51               do 
     52               { 
     53                    $host = $domain_elem[$i - 1].'.'.$host; 
     54                    $i--; 
     55                    if (substr(gethostbyname($host.'.'.$this->server),0,3) == "127" )  
     56                    { 
     57                         $status = substr($domain,0,128); 
     58                         return true; 
     59                    }                    
     60               } while ($i > 0); 
    5361          } 
    5462     } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map