Ticket #304 (closed bug: duplicate)
bug in ip2c on 64bit machines
| Reported by: | Watermark | Owned by: | omry |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | IP2Country | Version: | 1.2 |
| Severity: | Normal | Keywords: | |
| Cc: |
Description
hi,
the readInt()-funtion in ip2c.php does not work propertly on 64bit machines because the PHP-bug in the unpack-funtion on 64bit machines.
you have to change the ip2c.php file:
function readInt()
{
$a=unpack('N', fread($this->m_file, 4));
$b = sprintf("%b", $a[1]);
if(strlen($b) == 64){
$new = substr($b, 33);
$a[1] = bindec($new);
}
return $a[1];
}
the idea come from: http://www.php.net/manual/en/function.unpack.php
Best wishes from Germany.
Marek Malcherek http://watermark.malcherek.com
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
