In Loki We Trust The many projects of Lokkju, Inc

contact
advertise
9Jan/060

BAStats

BAStats is a statics package for tracking visitors to WordPress enabled sites. Though in beta stage, it works great in both WP 1.5 and 2.0, however it has a flaw in being able to store ip addresses where the initial quad is greater then 127. There have been a few ideas for fixes posted in the comments of the BAStats blog announcement, but not none of them seem to be effective.

After looking into the code for a while, I think I found the problem, and a simple fix. The stats package is attempting to write a signed integer value into an unsigned bigint database field (mysql only supports unsigned bigints perhaps?). The simple solution is to wrap all calls to the php function ip2long() in a sprintf function, converting the signed int into an unsigned one before writing it to the database.

Here is a unified diff patch for fixing this bug:

BAStats patch for fixing the 255.255.255.255 Bug

jobs
Filed under: Projects Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.

forum
tools