mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:39 +01:00
* Api: truncate varchar for all DB types now, as MariaDB 10.3 also errors on to big content
This commit is contained in:
parent
d65194fce3
commit
bb2557491d
@ -1483,9 +1483,8 @@ class Db
|
||||
{
|
||||
$value = implode($glue,$value);
|
||||
}
|
||||
// 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 && mb_strlen($value) > $length)
|
||||
// truncate to long strings for varchar(X) columns as PostgreSQL and newer MySQL/MariaDB given an error otherwise
|
||||
if (!is_null($length) && mb_strlen($value) > $length)
|
||||
{
|
||||
$value = mb_substr($value, 0, $length);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user