Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.3.7

Bug #16383 getDetails() returns no results if 1 result
Submitted: 2009-06-26 23:48 UTC
From: scottp Assigned: nohn
Status: Closed Package: Net_DNSBL (version 1.3.3)
PHP Version: 5.2.5 OS: 2.6.28 (Ubuntu 9.04)
Roadmaps: 1.3.4    

 [2009-06-26 23:48 UTC] scottp (Scott Prive)
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. scott@int:~$ uname -a Linux 2.6.28-12-generic #43-Ubuntu SMP Fri May 1 19:27:06 UTC 2009 i686 GNU/Linux scott@int:~$ php --version PHP 5.2.6-3ubuntu4.1 with Suhosin-Patch (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('',''); $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(""),TRUE); #echo "RESULT: " . print_r(get_dnsbl_array2(""),TRUE); #echo "RESULT: " . print_r(get_dnsbl_array2(""),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] => [1] => ) [results] => Array ( [] => Array ( [] => Array ( [record] => Array ( [0] => ) [txt] => Array ( [0] => ) ) ) ) ) [end object] (END) RESULT: Array ( [details] => )


 [2009-06-27 00:13 UTC] scottp (Scott Prive)
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.
 [2009-06-27 15:40 UTC] nohn (Sebastian Nohn)
-Status: Open +Status: Feedback
Sorry, I can't reproduce that. Please provide a test case that shows clearly what fails in which condition and what is your expected result in that condition. With your example, I get [exec] array(2) { [exec] [""]=> [exec] array(2) { [exec] ["record"]=> [exec] array(1) { [exec] [0]=> [exec] string(9) "" [exec] } [exec] ["txt"]=> [exec] array(1) { [exec] [0]=> [exec] string(59) "Blocked - see" [exec] } [exec] } [exec] [""]=> [exec] array(2) { [exec] ["record"]=> [exec] array(1) { [exec] [0]=> [exec] string(9) "" [exec] } [exec] ["txt"]=> [exec] array(1) { [exec] [0]=> [exec] string(66) "" [exec] } [exec] } [exec] } Which is what I would expect.
 [2009-06-27 15:41 UTC] nohn (Sebastian Nohn)
-Assigned To: +Assigned To: nohn
 [2009-07-02 08:46 UTC] scottp (Scott Prive)
OK, here's the thing.. you had 2 results/RBL hits in there, so you got both back from getDetails. If you can confirm the IP is listed on one of these RBLs - not both - you will see it hopefully. Please note my 'host' pre-flight test, before I run the PHP script. This shows the IP was on Barracudda and not on Spamcop. If by the time you try this you find the IP is re-listed on SpamCop, do not bother running the test. Try one of the other IPs (test them manually first). If all 3 suffer dual-blacklisting, I can try to scrounge up some other IPs from some RBL's database (hit or miss until I find one listed on just 'one' RBL). If you have a safe way to inject the data as my object dump shows, that may be a lot easier to reproduce. My results, same code: scott@scott-laptop:~$ host Host not found: 3(NXDOMAIN) scott@scott-laptop:~$ host has address scott@scott-laptop:~$ php ./test-dnsbl.php IS LISTED The object contains:Net_DNSBL Object ( [blacklists] => Array ( [0] => [1] => ) [results] => Array ( [] => Array ( [] => Array ( [record] => Array ( [0] => ) [txt] => Array ( [0] => ) ) ) ) ) [end object] (END) RESULT: Array ( [details] => <=== getDetails() showing nothing )
 [2009-07-26 15:08 UTC] nohn (Sebastian Nohn)
-Status: Feedback +Status: Open
 [2009-08-02 17:32 UTC] nohn (Sebastian Nohn)
-Status: Assigned +Status: Closed -Roadmap Versions: +Roadmap Versions: 1.3.4
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.