mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 16:48:49 +01:00
only truncate string if length given and <= 255, to not unnecessary truncate varchar(>255) as PostgreSQL uses text anyway and MySQL truncates itself silently (unless strict mode!)
This commit is contained in:
parent
1d743830c9
commit
25ddf016f4
@ -1463,7 +1463,9 @@ class egw_db
|
||||
{
|
||||
$value = implode($glue,$value);
|
||||
}
|
||||
if (!is_null($length) && strlen($value) > $length)
|
||||
// only truncate string if length given and <= 255
|
||||
// to not unnecessary truncate varchar(>255) as PostgreSQL uses text anyway and MySQL truncates itself silently (unless strict mode!)
|
||||
if (!is_null($length) && $length <= 255 && strlen($value) > $length)
|
||||
{
|
||||
$value = substr($value,0,$length);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user