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

Bug #16353 IsListed($ip, true) raises a warning if a blacklist doesn't have a TXT-record
Submitted: 2009-06-21 03:15 UTC
From: thecainer Assigned: nohn
Status: Closed Package: Net_DNSBL (version 1.3.2)
PHP Version: 5.2.0 OS: Unix
Roadmaps: 1.3.3    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 47 + 13 = ?

 
 [2009-06-21 03:15 UTC] thecainer (Arne Van der Stappen)
Description: ------------ When I set multiple blacklists and use IsListed($ip, true), it gives me the following warning: Warning: Invalid argument supplied for foreach() in /home/usr/PEAR/Net/DNSBL.php on line 240 I have determined that it happens when trying to lookup all TXT-records and that it fails because one of the blacklists didn't return a TXT-record. I did this by letting DNSBL.php print the name of the blacklist prior to getting all TXT-records for the blacklists. The error comes right after it printed the name of the blacklist that didn't return any TXT-records (rbl.efnetrbl.org). This also happens when only checking rbl.efnetrbl.org and still using IsListed($ip, true). It however does not happen when only checking rbl.efnetrbl.org and also setting the checkall parameter to false. Test script: --------------- include("Net/DNSBL.php"); $ip = "79.141.17.68"; $dnsbl = new Net_DNSBL(); $blacklists = array('dnsbl.sorbs.net','rbl.efnetrbl.org','dnsbl.dronebl.org','xbl.spamhaus.org','tor.dnsbl.sectoor.de','cbl.abuseat.org','dnsbl.njabl.org'); $dnsbl->setBlacklists($blacklists); if ($dnsbl->isListed($ip, true)) { print_r($dnsbl->getDetails($ip)); } Expected result: ---------------- I expected it to return me the details of the blacklistmatches it could find for the ip. The IP is in the following blacklists (at the moment of testing): dnsbl.sorbs.net, rbl.efnetrbl.org, xbl.spamhaus.org and cbl.abuseat.org Actual result: -------------- It does what I expected, except that it first gives this warning: Warning: Invalid argument supplied for foreach() in /home/usr/PEAR/Net/DNSBL.php on line 240 For each of the 4 matching blacklists it gives me 1 record. I also get a TXT-record for each blacklist except for rbl.efnetrbl.org.

Comments

 [2009-06-21 05:32 UTC] thecainer (Arne Van der Stappen)
-Operating System: Unic +Operating System: Unix
 [2009-06-21 16:16 UTC] nohn (Sebastian Nohn)
-Assigned To: +Assigned To: nohn -Roadmap Versions: +Roadmap Versions: 1.3.3
 [2009-06-21 16:43 UTC] nohn (Sebastian Nohn)
-Status: Assigned +Status: Closed
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/ Fixed in 1.3.3