Hello/Hi/Greetings,
since the update to 15.0.0 the size of the IP field in the history table (piwigo_history) has been increased to 39 characters. Nevertheless the IPv6 addresses saved are still truncated to 15 characters.
Is there a missing update in some .php file that truncates the IPv6 address to 15 characters before saving it to the database?
Thanks
Offline
That's perfectly right. I forgot to remove a piece of code! Can you test a change and tell me if it works fine?
In your file include/functions.inc.php line 471 and 473 change "15" for "39".
$ip = $_SERVER['REMOTE_ADDR']; // In case of "too long" ipv6 address, we take only the 15 first chars. // // It would be "cleaner" to increase length of history.IP to 50 chars, but // the alter table is very long on such a big table. We should plan this // for a future version, once history table is kept "smaller". if (strpos($ip,':') !== false and strlen($ip) > 15) { $ip = substr($ip, 0, 15); }
Offline
Thanks, that piece what I was looking for but could find it.
After the change the IPv6 addresses are now saved completely.
Thanks, I guess the change will go to the next minor update of piwigo.
Klaus
Offline
n.b. please change also the comment mentioning the truncation to 15 characters, now 39 characters.
Offline