Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] IP search bug when ip >=
(2008-09-08, 10:45 PM)Ryan Gordon Wrote: This'll be fixed in 1.4.1
Better in 1.4.2 Wink

(2008-09-08, 11:02 PM)Ryan Gordon Wrote: Can you put this file in your main directory and run it via your browser? Delete it afterward, and see if it fixes your problems.


Edit: Sorry, there was a bug in the file.
Ok. Let's see:

(first of all, the file has a little typo: it's longregip instead of logrepip, in the first write_query; but that has not been a problem)

So: the file executes correctly:
Performing necessary queries..

Repairing ip's 1 - 11


All post ips have been converted to the new ip format.

Repairing ip's 1 - 6...


All user ips have been converted to the new ip format.

Completed the update, please delete this file now.
But I have still the same problem. In phpmyadmin I can see that now the columns are int(11) instead of int(10), but their values are still positive numbers. For some reason, the update queries of fixips.php were not able to update those values. I don't know why.

IMHO, wouldn't it be easier to modify modcp.php in order to make que query using a positive number instead of modifying the DB? Something like this:
$post_ip_sql = "longipaddress='" . sprintf("%u", $ip_range) . "'";
Or maybe it doesn't worth it, because there are lots of places in the code where fetch_longipv4_range is used... i don't know.

Edit: i've just quickly tested the sprintf workarround and it seems not to work Sad ... it's too late at night here, maybe tomorrow i'll give it another try Toungue

Edit2: In the DB I have the number 2147483647 in the longip columns for the rows with ip =; but that number is 0x7FFFFFFF (the maximun positive integer number in 2's complement using 32 bits) and that number is not the value returned by ip2long (or, at least, it should not be). And that happens before and after applying the patch. Maybe that can be a clue for you Wink
[Image: choli_av.php]

Messages In This Thread
[F] IP search bug when ip >= - by Choli - 2008-09-08, 10:22 PM
RE: [F] IP search bug when ip >= - by Choli - 2008-09-08, 11:37 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)