diff --git a/phpgwapi/inc/class.egw_db.inc.php b/phpgwapi/inc/class.egw_db.inc.php index b27e580093..1c770371be 100644 --- a/phpgwapi/inc/class.egw_db.inc.php +++ b/phpgwapi/inc/class.egw_db.inc.php @@ -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); }