mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-24 08:53:37 +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
3b9f7b3d6d
commit
28354db5d5
@ -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