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

Bug #17476 [test.com] Undefined index: server
Submitted: 2010-06-09 17:12 UTC
From: hm2k Assigned: kguest
Status: Closed Package: Net_Whois (version SVN)
PHP Version: 5.3.2 OS:
Roadmaps: 1.0.4    
Subscription  


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 : 28 - 26 = ?

 
 [2010-06-09 17:12 UTC] hm2k (James Wade)
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

Comments

 [2010-06-09 17:13 UTC] hm2k (James Wade)
 [2010-06-09 17:52 UTC] kguest (Ken Guest)
-Assigned To: +Assigned To: kguest
 [2010-06-09 17:59 UTC] kguest (Ken Guest)
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 ;-)
 [2010-06-09 18:18 UTC] hm2k (James Wade)
Excuse my ignorance but I don't see the term "patch" on that page, which specific section should I be looking at? Meanwhile, I managed to locate the instructions for submitting a patch here: http://pear.php.net/manual/en/contributing.patches.php Unfortunately I see no Windows support. The patch I have already provided is a standard WinMerge patch. Instead, I was able to output an svn diff using my Linux dev machine (to follow).
 [2010-06-09 18:19 UTC] hm2k (James Wade)
 [2010-06-09 19:18 UTC] kguest (Ken Guest)
-Status: Assigned +Status: Closed
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. fixed up the patch so resulting code adheres to the PEAR Coding Standards - all ok.