Changeset 2522:2712786c6df4
Legend:
- Unmodified
- Added
- Removed
-
plugins/antispam/filters/class.dc.filter.linkslookup.php
r1366 r2522 15 15 { 16 16 public $name = 'Links Lookup'; 17 17 18 18 private $server = 'multi.surbl.org'; 19 19 20 20 protected function setInfo() 21 21 { 22 22 $this->description = __('Checks links in comments against surbl.org'); 23 23 } 24 24 25 25 public function getStatusMessage($status,$comment_id) 26 26 { 27 27 return sprintf(__('Filtered by %1$s with server %2$s.'),$this->guiLink(),$status); 28 28 } 29 29 30 30 public function isSpam($type,$author,$email,$site,$ip,$content,$post_id,&$status) 31 31 { … … 33 33 return; 34 34 } 35 35 36 36 $urls = $this->getLinks($content); 37 37 array_unshift($urls,$site); 38 38 39 39 foreach ($urls as $u) 40 40 { … … 48 48 49 49 $i = count($domain_elem) - 1; 50 if ($i == 0) { 51 // "domain" is 1 word long, don't check it 52 return false; 53 } 50 54 $host = $domain_elem[$i]; 51 55 do … … 53 57 $host = $domain_elem[$i - 1].'.'.$host; 54 58 $i--; 55 if (substr(gethostbyname($host.'.'.$this->server),0,3) == "127" ) 59 if (substr(gethostbyname($host.'.'.$this->server),0,3) == "127" ) 56 60 { 57 61 $status = substr($domain,0,128); 58 62 return true; 59 } 63 } 60 64 } while ($i > 0); 61 65 } 62 66 } 63 67 64 68 private function getLinks($text) 65 69 {
Note: See TracChangeset
for help on using the changeset viewer.