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

Bug #17474 Notice: Trying to get property of non-object in /usr/lib/php/Net/DNSBL.php on
Submitted: 2010-06-08 01:01 UTC
From: hm2k Assigned: nohn
Status: Closed Package: Net_DNSBL (version 1.3.3)
PHP Version: 5.3.2 OS: Linux
Roadmaps: 1.3.5    
Subscription  


 [2010-06-08 01:01 UTC] hm2k (James Wade)
Description: ------------ Looking up a host that is in a DNS Blacklist results in the following errors: Notice: Trying to get property of non-object in /usr/lib/php/Net/DNSBL.php on line 286 Test script: --------------- <? $host='maga.info'; //pear install Net_DNSBL-1.3.3 require_once 'Net/DNSBL.php'; $dnsbl = new Net_DNSBL(); if ($dnsbl->isListed($host)) { echo $dnsbl->getListingBl($host); } ?> Expected result: ---------------- bl.spamcop.net Actual result: -------------- Notice: Trying to get property of non-object in /usr/lib/php/Net/DNSBL.php on line 286 Notice: Trying to get property of non-object in /usr/lib/php/Net/DNSBL.php on line 286 Notice: Trying to get property of non-object in /usr/lib/php/Net/DNSBL.php on line 286 Notice: Trying to get property of non-object in /usr/lib/php/Net/DNSBL.php on line 286 Notice: Trying to get property of non-object in /usr/lib/php/Net/DNSBL.php on line 286 Notice: Trying to get property of non-object in /usr/lib/php/Net/DNSBL.php on line 286 bl.spamcop.net

Comments

 [2010-06-08 03:41 UTC] doconnor (Daniel O'Connor)
Can I get you to try the latest SVN version? The line numbers are slightly off. Otherwise, I assume it's getHostForLookup() assuming there's always a well formed response. protected function getHostForLookup($host, $blacklist) { // Currently only works for v4 addresses. if (!Net_CheckIP::check_ip($host)) { $resolver = new Net_DNS_Resolver; $response = $resolver->query($host); $ip = $response->answer[0]->address; } else { $ip = $host; } return $this->buildLookUpHost($ip, $blacklist); } /
 [2010-06-08 03:42 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Analyzed
 [2010-06-09 18:03 UTC] hm2k (James Wade)
I retrieved the latest svn as follows: svn checkout http://svn.php.net/repository/pear/packages/Net_DNSBL/trunk Net_DNSBL pear package Net_DNSBL/package.xml pear uninstall Net_DNSBL pear install Net_DNSBL rm -fr Net_DNSBL I am still seeing the following errors: [09-Jun-2010 14:08:55] PHP Notice: Trying to get property of non-object in /usr/lib/php/Net/DNSBL.php on line 286 [09-Jun-2010 14:08:55] PHP Notice: Trying to get property of non-object in /usr/lib/php/Net/DNSBL.php on line 286 [09-Jun-2010 14:08:55] PHP Notice: Trying to get property of non-object in /usr/lib/php/Net/DNSBL.php on line 286 [09-Jun-2010 14:08:55] PHP Notice: Trying to get property of non-object in /usr/lib/php/Net/DNSBL.php on line 286 [09-Jun-2010 14:09:07] PHP Notice: Undefined property: Net_DNS_RR_CNAME::$address in /usr/lib/php/Net/DNSBL.php on line 286 [09-Jun-2010 14:09:07] PHP Notice: Undefined property: Net_DNS_RR_CNAME::$address in /usr/lib/php/Net/DNSBL.php on line 286 The errors also occur on the "127.0.0.2" test ip.
 [2010-06-09 19:34 UTC] hm2k (James Wade)
My mistake, I am unable to replicate the bug using: "127.0.0.2" However, the bug appears when using: "127.0.0.2." With regards to the getHostForLookup function, why not change dependencies from Net_CheckIP to filter_var with FILTER_VALIDATE_IP?
 [2010-07-07 16:41 UTC] hm2k (James Wade)
Are you able to replicate this bug or do you require further information? Thanks.
 [2010-07-21 13:32 UTC] hm2k (James Wade)
I realised a mistake when installing the SVN version... s/pear install Net_DNSBL/pear install Net_DNSBL/package.xml [root@svr ~]# pear install Net_DNSBL/package.xml install ok: channel://pear.php.net/Net_DNSBL-1.3.4dev --- Here's an updated version of the error: For 127.0.0.2: bool(true) string(20) "sbl-xbl.spamhaus.org" For 127.0.0.2.: bool(true) string(20) "sbl-xbl.spamhaus.org" For maga.info.: Notice: Trying to get property of non-object in /usr/share/pear/Net/DNSBL.php on line 291 Notice: Trying to get property of non-object in /usr/share/pear/Net/DNSBL.php on line 291 Notice: Trying to get property of non-object in /usr/share/pear/Net/DNSBL.php on line 291 Notice: Trying to get property of non-object in /usr/share/pear/Net/DNSBL.php on line 291 Notice: Trying to get property of non-object in /usr/share/pear/Net/DNSBL.php on line 291 Notice: Trying to get property of non-object in /usr/share/pear/Net/DNSBL.php on line 291 bool(true) string(14) "bl.spamcop.net" --- Code to reproduce: <?php $hosts[]='127.0.0.2'; //known test entry $hosts[]='127.0.0.2.'; $hosts[]='maga.info.'; //produces an error require_once 'Net/DNSBL.php'; $dnsbl = new Net_DNSBL(); foreach ($hosts as $host) { echo "<p>For $host:</p>"; var_dump($dnsbl->isListed($host)); var_dump($dnsbl->getListingBl($host)); } ?> --- Can you confirm that you are able to reproduce this bug? Thanks.
 [2010-07-21 13:41 UTC] hm2k (James Wade)
 [2010-10-21 05:14 UTC] hm2k (James Wade)
Can someone apply this fix already?
 [2010-10-23 13:02 UTC] nohn (Sebastian Nohn)
-Status: Analyzed +Status: Closed -Assigned To: +Assigned To: nohn
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net 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.