diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 7f100231..547284cc 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -251,7 +251,7 @@ function is_utf8($val) { } function shorten_utf8($string, $length = 80, $suffix = "") { - preg_match("~^(.{0,$length})(.?)~su", $string, $match); + preg_match("~^((?:.|\n){0,$length})(.|\n)?~u", $string, $match); // ~s causes trash in $match[2] under some PHP versions return htmlspecialchars($match[1]) . $suffix . ($match[2] ? "..." : ""); }