Bug #16061 [Opn->Ver]: Invalid argument supplied for foreach()

From: Date: Sat, 04 Apr 2009 12:05:08 +0000
Subject: Bug #16061 [Opn->Ver]: Invalid argument supplied for foreach()
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-307@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=16061&edit=1 ID: 16061 Updated by: sebastian@nohn.net Reported By: secrtagnt at gmail dot com Summary: Invalid argument supplied for foreach() -Status: Open +Status: Verified Type: Bug Package: Net_DNSBL Operating System: Linux 2.6.28-gentoo-r3 Package Version: 1.3.0 PHP Version: 5.2.9 -Assigned To: +Assigned To: nohn Roadmap Versions: New Comment: -Status: Open +Status: Verified -Assigned To: +Assigned To: nohn Previous Comments: ------------------------------------------------------------------------ [2009-04-03 02:18:22] secrtagnt Description: ------------ Tried a few of the examples listed in the documentation, and while it appears to work, I'm also getting warnings in the output. Test script: --------------- <?php require_once 'Net/DNSBL.php'; $dnsbl = new Net_DNSBL(); $dnsbl->setBlacklists(array('rbl.efnet.org')); if ($dnsbl->isListed($_SERVER['REMOTE_ADDR'])) { var_dump($dnsbl->getDetails($_SERVER['REMOTE_ADDR'])); var_dump($dnsbl->getTxt($_SERVER['REMOTE_ADDR'])); var_dump($dnsbl->getListingBl($_SERVER['REMOTE_ADDR'])); var_dump($dnsbl->getListingRecord($_SERVER['REMOTE_ADDR'])); } ?> Expected result: ---------------- array 'dnsbl' => string 'rbl.efnet.org' (length=13) 'record' => string '127.0.0.4' (length=9) string 'rbl.efnet.org' (length=13) string '127.0.0.4' (length=9) Actual result: -------------- Warning: Invalid argument supplied for foreach() in /usr/share/php/Net/DNSBL.php on line 240 Call Stack # Time Memory Function Location 1 0.0002 66864 {main}( ) ../dnsbl.php:0 2 0.0220 977160 Net_DNSBL->isListed( ) ../dnsbl.php:5 Dump $_SERVER Dump $_GET Dump $_POST Dump $_COOKIE Dump $_FILES Dump $_ENV Dump $_SESSION Dump $_REQUEST array 'dnsbl' => string 'rbl.efnet.org' (length=13) 'record' => string '127.0.0.4' (length=9) string 'rbl.efnet.org' (length=13) string '127.0.0.4' (length=9) ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=16061&edit=1

« previous php.pear.bugs (#307) next »