Edit report at http://pear.php.net/bugs/bug.php?id=16383&edit=1
ID: 16383
Updated by: [email protected]
Reported By: scottprive at gmail dot com
Summary: getDetails() returns no results if 1 result
Status: Open
Type: Bug
Package: Net_DNSBL
Operating System: 2.6.28 (Ubuntu 9.04)
Package Version: 1.3.3
PHP Version: 5.2.5
Roadmap Versions:
New Comment:
If I change line 11 from:
$result['details'] = $dnsbl->getDetails($ip);
to:
$result['details'] = $dnsbl->results;
I get the expected results set.
That is to say, I alternated between the above two line 11's, and
getDetails would return nothing, but $dnsbl->$results returned correct.
Previous Comments:
------------------------------------------------------------------------
[2009-06-26 19:48:55] scottp
Description:
------------
getDetails can return no results/listings, when the dnsbl object's
public variables clearly show there are listings.
In my testing this seems to happen when querying multiple RBLs and that
IP is not listed on all of them. If the IP is listed on all RBLs I get
all results back from getDetails().
Not 100% sure but it seems to happen if the checked IP is only on 1 RBL
and that RBL is Barracuda's.
[email protected]:~$ uname -a
Linux int.scott.tzo.com 2.6.28-12-generic #43-Ubuntu SMP Fri May 1
19:27:06 UTC 2009 i686 GNU/Linux
[email protected]:~$ php --version
PHP 5.2.6-3ubuntu4.1 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 23
2009 14:35:05)
Test script:
---------------
<?php
require_once 'Net/DNSBL.php';
function get_dnsbl_array2($ip) {
$dnsbl = new Net_DNSBL();
$rbls = array('bl.spamcop.net','b.barracudacentral.org');
$dnsbl->setBlacklists($rbls);
if ($dnsbl->isListed($ip, TRUE)) {
echo "\n IS LISTED \nThe object contains:" .
print_r($dnsbl,TRUE)." [end object] (END)\n";
$result['details'] = $dnsbl->getDetails($ip);
}
return $result;
}
#happens if IP is on one blacklist only?
echo "RESULT: " . print_r(get_dnsbl_array2("82.217.205.25"),TRUE);
#echo "RESULT: " . print_r(get_dnsbl_array2("125.110.99.250"),TRUE);
#echo "RESULT: " . print_r(get_dnsbl_array2("77.104.239.1"),TRUE);
?>
Expected result:
----------------
Expecting getDetails() to be the same data (all data) from
$dnsbl['results'].
Actual result:
--------------
IS LISTED
The object contains:Net_DNSBL Object
(
[blacklists] => Array
(
[0] => bl.spamcop.net
[1] => b.barracudacentral.org
)
[results] => Array
(
[82.217.205.25] => Array
(
[b.barracudacentral.org] => Array
(
[record] => Array
(
[0] => 127.0.0.2
)
[txt] => Array
(
[0] =>
http://www.barracudanetworks.com/reputation/?pr=1&ip=82.217.205.25
)
)
)
)
)
[end object] (END)
RESULT: Array
(
[details] =>
)
------------------------------------------------------------------------