cvs: php-master-web /entry user-note.php
| From: | Nuno Lopes | Date: | Mon, 23 Jan 2006 13:50:38 +0000 |
| Subject: | cvs: php-master-web /entry user-note.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-30455@lists.php.net to get a copy of this message | ||
nlopess Mon Jan 23 13:50:38 2006 UTC
Modified files:
/php-master-web/entry user-note.php
Log:
extend the is_spammer() function to allow us to exclude some zones (in this case I'm
excluding the dynamic IPs, as they are perfectly valid for note submitters)
http://cvs.php.net/viewcvs.cgi/php-master-web/entry/user-note.php?r1=1.38&r2=1.39&diff_format=u
Index: php-master-web/entry/user-note.php
diff -u php-master-web/entry/user-note.php:1.38 php-master-web/entry/user-note.php:1.39
--- php-master-web/entry/user-note.php:1.38 Sat Jan 21 20:53:00 2006
+++ php-master-web/entry/user-note.php Mon Jan 23 13:50:37 2006
@@ -123,13 +123,15 @@
$reverse_ip = implode('.', array_reverse(explode('.', $ip)));
// spammers lists
- $lists[] = 'list.dsbl.org';
- $lists[] = 'dnsbl.sorbs.net';
+ // [0] => dns server, [1] => exclude ip
+ $lists[] = array('list.dsbl.org');
+ $lists[] = array('dnsbl.sorbs.net', '127.0.0.10'); // exclude dynamic ips
list
foreach ($lists as $list) {
- $host = $reverse_ip . '.' . $list;
+ $host = $reverse_ip . '.' . $list[0];
+ $dns = gethostbyname($host);
- if (gethostbyname($host) != $host) {
+ if ($dns != $host && (empty($list[1]) || $dns != $list[1])) {
return true;
}
}