Home » Networking » Net_GeoIP » Bug #10198
method lookupCountryId throws exception on valid IP
Details
| Submitted | 2007-02-26 21:23 UTC |
|---|---|
| From | davetay1021 at gmail dot com |
| Status | Bogus |
| Package | Net_GeoIP |
| PHP Version | 5.2.0 |
| OS | CentOS 4.4 |
| Roadmaps | (Not assigned) |
Comments
[2007-02-26 21:23 UTC] davetay1021 at gmail dot com
Description:
------------
The method lookupCountryId throws an exception on line 540 stating that the given IP is invalid, even on valid IPs. The method excepts 1 parameter, a string, the IP address. It looks like the parameter being passed into this method is an array ("ip" => '0.0.0.0').
Changing line 538 from "$ipnum = ip2long($addr);" to "$ipnum = ip2long($addr['ip']);" takes care of the problem.
[2007-02-26 21:47 UTC] hlellelid at php dot net
Please note that the lookupCountryCode() method expects to be passed a valid IP address. If you are passing an array ("ip" => "0.0.0.0") into this method, it will fail. I.e. this sounds like a problem with the way you are calling a method in the library.