Bug #17476 [Asn]: [test.com] Undefined index: server

From: Date: Wed, 09 Jun 2010 13:59:09 +0000
Subject: Bug #17476 [Asn]: [test.com] Undefined index: server
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-3904@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=17476&edit=1 ID: 17476 Updated by: ken@linux.ie Reported By: hm2k at php dot net Summary: [test.com] Undefined index: server Status: Assigned Type: Bug Package: Net_Whois Package Version: SVN PHP Version: 5.3.2 Assigned To: kguest Roadmap Versions: New Comment: please submit a proper patch file - one that can be applied with the patch tool. It would help if your changes adhered to the PEAR coding standards (http://pear.php.net/manual/en/standards.php) Doing so will help speed up accepting your bug fix ;-) Previous Comments: ------------------------------------------------------------------------ [2010-06-09 13:52:32] kguest -Assigned To: +Assigned To: kguest ------------------------------------------------------------------------ [2010-06-09 13:13:47] hm2k Added #patch bug:17476;patch:authoritative-server-fix;revision:1276089227;. ------------------------------------------------------------------------ [2010-06-09 13:12:55] hm2k Description: ------------ The current version of Net_Whois is returning errors when it can't parse the "setAuthoritative" whois server. The script has a few issues: 1. The whois server parsing was messy, I'm surprised it even worked. 2. The script used "=$domain", instead of 'domain '.$domain which returns less data for parsing. 3. There was an extra unnecessary connection. I've fixed these issues. Diff patch included. Test script: --------------- <?php $q=isset($_REQUEST['q'])?htmlspecialchars($_REQUEST['q']):NULL; $s=isset($_REQUEST['s'])?htmlspecialchars($_REQUEST['s']):NULL; if (strchr($q,'.')) { require_once 'Net_Whois.php'; $whois = new Net_Whois; $q=strtolower($q); if (!$s && $q[0] == '.') { $s='whois.iana.org'; } $q=trim($q,'.'); $tld=pathinfo($q,PATHINFO_EXTENSION); if ($tld=='com') {$whois->setAuthoritative(1);} elseif ($tld=='name') {$q='domain = '.$q;} $data=htmlspecialchars($whois->query($q,$s)); echo "<pre>$data</pre>"; } ?> Expected result: ---------------- [whois record for test.com] Actual result: -------------- Notice: Undefined property: Net_Whois::$timeout in /home/.../Net_Whois.php on line 313 Notice: Undefined index: server in /home/.../Net_Whois.php on line 199 Notice: Undefined index: server in /home/.../Net_Whois.php on line 200 Notice: Undefined property: Net_Whois::$timeout in /home/.../Net_Whois.php on line 313 Unable to open socket ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=17476&edit=1

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