Bug #16204
Updated by Pascal Rössler about 1 year ago
maxLength is automatically set based on the column type maxlength of the database.
addding a check if a typeahead is set resolves this issue.
<pre>
if ($this->maxLength > 0 && $this->value !== '') {
// Check if there are \r\n > those should be counted as one char, not two. #13030
$crlf = substr_count($this->value, "\r\n");
$max = $this->maxLength + $crlf;
// crop string only if it's not empty (substr returns false on empty strings)
$this->value = mb_substr($this->value, 0, $max);
}
</pre>