mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-06 16:53:34 +02:00
fixes #2265 no longer truncate IP at 15 chars
This commit is contained in:
@@ -463,14 +463,11 @@ UPDATE '.USER_INFOS_TABLE.'
|
|||||||
}
|
}
|
||||||
|
|
||||||
$ip = $_SERVER['REMOTE_ADDR'];
|
$ip = $_SERVER['REMOTE_ADDR'];
|
||||||
// In case of "too long" ipv6 address, we take only the 15 first chars.
|
// IPv6 should not be longer than 39 chars, and that is the maximum length of
|
||||||
//
|
// the column in the database, but in case it would be longer, let's truncate it.
|
||||||
// It would be "cleaner" to increase length of history.IP to 50 chars, but
|
if (strlen($ip) > 39)
|
||||||
// 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);
|
$ip = substr($ip, 0, 39);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If plugin developers add their own sections, Piwigo will automatically add it in the history.section enum column
|
// If plugin developers add their own sections, Piwigo will automatically add it in the history.section enum column
|
||||||
|
|||||||
Reference in New Issue
Block a user