cvs: pear /Net_DNSBL package.xml /Net_DNSBL/Net DNSBL.php /Net_DNSBL/Net/DNSBL SURBL.php /Net_DNSBL/tests AllTests.php testNetDNSBL.php
testNetDNSBLSURBL.php
| From: | Sebastian Nohn | Date: | Sat, 04 Apr 2009 14:29:57 +0000 |
| Subject: | cvs: pear /Net_DNSBL package.xml /Net_DNSBL/Net DNSBL.php /Net_DNSBL/Net/DNSBL SURBL.php /Net_DNSBL/tests AllTests.php testNetDNSBL.php testNetDNSBLSURBL.php |
||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-55884@lists.php.net to get a copy of this message | ||
nohn Sat Apr 4 14:29:57 2009 UTC
Modified files:
/pear/Net_DNSBL package.xml
/pear/Net_DNSBL/Net DNSBL.php
/pear/Net_DNSBL/Net/DNSBL SURBL.php
/pear/Net_DNSBL/tests AllTests.php testNetDNSBL.php
testNetDNSBLSURBL.php
Log:
fix #16061
http://cvs.php.net/viewvc.cgi/pear/Net_DNSBL/package.xml?r1=1.36&r2=1.37&diff_format=u
Index: pear/Net_DNSBL/package.xml
diff -u pear/Net_DNSBL/package.xml:1.36 pear/Net_DNSBL/package.xml:1.37
--- pear/Net_DNSBL/package.xml:1.36 Sat Nov 22 16:27:39 2008
+++ pear/Net_DNSBL/package.xml Sat Apr 4 14:29:56 2009
@@ -16,9 +16,9 @@
<email>ammar@gnuix.com</email>
<active>no</active>
</developer>
- <date>2007-08-11</date>
+ <date>2009-04-04</date>
<version>
- <release>1.3.0</release>
+ <release>1.3.1</release>
<api>1.3.0</api>
</version>
<stability>
@@ -26,8 +26,7 @@
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP
License</license>
- <notes>* Fix coding style
-* Allow querying multiple RBLs at once</notes>
+ <notes>* Fix #16061</notes>
<contents>
<dir name="/">
<dir name="Net">
http://cvs.php.net/viewvc.cgi/pear/Net_DNSBL/Net/DNSBL.php?r1=1.11&r2=1.12&diff_format=u
Index: pear/Net_DNSBL/Net/DNSBL.php
diff -u pear/Net_DNSBL/Net/DNSBL.php:1.11 pear/Net_DNSBL/Net/DNSBL.php:1.12
--- pear/Net_DNSBL/Net/DNSBL.php:1.11 Sat Nov 22 14:45:17 2008
+++ pear/Net_DNSBL/Net/DNSBL.php Sat Apr 4 14:29:56 2009
@@ -23,9 +23,9 @@
* @package Net_DNSBL
* @author Sebastian Nohn <sebastian@nohn.net>
* @author Ammar Ibrahim <fixxme@fixme.com>
- * @copyright 2004-2008 Sebastian Nohn <sebastian@nohn.net>
+ * @copyright 2004-2009 Sebastian Nohn <sebastian@nohn.net>
* @license http://www.php.net/license/3_01.txt
PHP License 3.01
- * @version CVS: $Id: DNSBL.php,v 1.11 2008/11/22 14:45:17 nohn Exp $
+ * @version CVS: $Id: DNSBL.php,v 1.12 2009/04/04 14:29:56 nohn Exp $
* @link http://pear.php.net/package/Net_DNSBL
* @see Net_DNS
* @since File available since Release 1.0.0
@@ -214,6 +214,10 @@
$isListed = false;
$resolver = new Net_DNS_Resolver;
+ if (!is_string($host)) {
+ return false;
+ }
+
foreach ($this->blacklists as $blacklist) {
$response = $resolver->query($this->getHostForLookup($host, $blacklist));
if ($response) {
@@ -238,8 +242,10 @@
$resolver->query($this->getHostForLookup($host,
$blacklist),
'TXT');
- foreach ($response_txt->answer as $txt) {
- $this->results[$host]['txt'][] = $txt->text[0];
+ if ((isset($response_txt)) && ($response_txt != false)) {
+ foreach ($response_txt->answer as $txt) {
+ $this->results[$host]['txt'][] = $txt->text[0];
+ }
}
// if the Host was listed we don't need to check other RBLs,
break;
http://cvs.php.net/viewvc.cgi/pear/Net_DNSBL/Net/DNSBL/SURBL.php?r1=1.9&r2=1.10&diff_format=u
Index: pear/Net_DNSBL/Net/DNSBL/SURBL.php
diff -u pear/Net_DNSBL/Net/DNSBL/SURBL.php:1.9 pear/Net_DNSBL/Net/DNSBL/SURBL.php:1.10
--- pear/Net_DNSBL/Net/DNSBL/SURBL.php:1.9 Sat Nov 22 14:45:17 2008
+++ pear/Net_DNSBL/Net/DNSBL/SURBL.php Sat Apr 4 14:29:56 2009
@@ -22,9 +22,9 @@
* @package Net_DNSBL
* @author Sebastian Nohn <sebastian@nohn.net>
* @author Ammar Ibrahim <fixxme@fixme.com>
- * @copyright 2004-2008 Sebastian Nohn <sebastian@nohn.net>
+ * @copyright 2004-2009 Sebastian Nohn <sebastian@nohn.net>
* @license http://www.php.net/license/3_01.txt
PHP License 3.01
- * @version CVS: $Id: SURBL.php,v 1.9 2008/11/22 14:45:17 nohn Exp $
+ * @version CVS: $Id: SURBL.php,v 1.10 2009/04/04 14:29:56 nohn Exp $
* @link http://pear.php.net/package/Net_DNSBL
* @see Net_DNS
* @since File available since Release 1.0.0
http://cvs.php.net/viewvc.cgi/pear/Net_DNSBL/tests/AllTests.php?r1=1.7&r2=1.8&diff_format=u
Index: pear/Net_DNSBL/tests/AllTests.php
diff -u pear/Net_DNSBL/tests/AllTests.php:1.7 pear/Net_DNSBL/tests/AllTests.php:1.8
--- pear/Net_DNSBL/tests/AllTests.php:1.7 Sat Nov 22 14:45:17 2008
+++ pear/Net_DNSBL/tests/AllTests.php Sat Apr 4 14:29:56 2009
@@ -21,9 +21,9 @@
* @category Net
* @package Net_DNSBL
* @author Sebastian Nohn <sebastian@nohn.net>
- * @copyright 2004-2008 Sebastian Nohn <sebastian@nohn.net>
+ * @copyright 2004-2009 Sebastian Nohn <sebastian@nohn.net>
* @license http://www.php.net/license/3_01.txt
PHP License 3.01
- * @version CVS: $Id: AllTests.php,v 1.7 2008/11/22 14:45:17 nohn Exp $
+ * @version CVS: $Id: AllTests.php,v 1.8 2009/04/04 14:29:56 nohn Exp $
* @link http://pear.php.net/package/Net_DNSBL Package Home
* @see Net_DNS
* @since File available since Release 1.0.0
http://cvs.php.net/viewvc.cgi/pear/Net_DNSBL/tests/testNetDNSBL.php?r1=1.21&r2=1.22&diff_format=u
Index: pear/Net_DNSBL/tests/testNetDNSBL.php
diff -u pear/Net_DNSBL/tests/testNetDNSBL.php:1.21 pear/Net_DNSBL/tests/testNetDNSBL.php:1.22
--- pear/Net_DNSBL/tests/testNetDNSBL.php:1.21 Sat Nov 22 14:45:17 2008
+++ pear/Net_DNSBL/tests/testNetDNSBL.php Sat Apr 4 14:29:57 2009
@@ -21,9 +21,9 @@
* @category Net
* @package Net_DNSBL
* @author Sebastian Nohn <sebastian@nohn.net>
- * @copyright 2004-2008 Sebastian Nohn <sebastian@nohn.net>
+ * @copyright 2004-2009 Sebastian Nohn <sebastian@nohn.net>
* @license http://www.php.net/license/3_01.txt
PHP License 3.01
- * @version CVS: $Id: testNetDNSBL.php,v 1.21 2008/11/22 14:45:17 nohn Exp $
+ * @version CVS: $Id: testNetDNSBL.php,v 1.22 2009/04/04 14:29:57 nohn Exp $
* @link http://pear.php.net/package/Net_DNSBL Package Home
* @see Net_DNS
* @since File available since Release 1.0.0
@@ -251,5 +251,23 @@
$this->assertFalse($this->_rbl->isListed(md5(rand()).'.nohn.net'));
}
}
+
+ /**
+ * Test Bokus
+ *
+ * @return boolean true on success, false on failure
+ */
+ public function testBogusInput()
+ {
+ $this->_rbl->setBlacklists(array('rbl.efnet.org'));
+ $this->assertFalse($this->_rbl->isListed(null));
+ $this->assertFalse($this->_rbl->getTxt(null));
+ $this->assertFalse($this->_rbl->isListed(false));
+ $this->assertFalse($this->_rbl->getTxt(false));
+ $this->assertFalse($this->_rbl->isListed(true));
+ $this->assertFalse($this->_rbl->getTxt(true));
+
+ }
+
}
?>
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/pear/Net_DNSBL/tests/testNetDNSBLSURBL.php?r1=1.16&r2=1.17&diff_format=u
Index: pear/Net_DNSBL/tests/testNetDNSBLSURBL.php
diff -u pear/Net_DNSBL/tests/testNetDNSBLSURBL.php:1.16
pear/Net_DNSBL/tests/testNetDNSBLSURBL.php:1.17
--- pear/Net_DNSBL/tests/testNetDNSBLSURBL.php:1.16 Sat Nov 22 14:45:17 2008
+++ pear/Net_DNSBL/tests/testNetDNSBLSURBL.php Sat Apr 4 14:29:57 2009
@@ -21,9 +21,9 @@
* @category Net
* @package Net_DNSBL
* @author Sebastian Nohn <sebastian@nohn.net>
- * @copyright 2004-2008 Sebastian Nohn <sebastian@nohn.net>
+ * @copyright 2004-2009 Sebastian Nohn <sebastian@nohn.net>
* @license http://www.php.net/license/3_01.txt
PHP License 3.01
- * @version CVS: $Id: testNetDNSBLSURBL.php,v 1.16 2008/11/22 14:45:17 nohn Exp $
+ * @version CVS: $Id: testNetDNSBLSURBL.php,v 1.17 2009/04/04 14:29:57 nohn Exp $
* @link http://pear.php.net/package/Net_DNSBL Package Home
* @see Net_DNS
* @since File available since Release 1.0.0