mirror of
https://github.com/vrana/adminer.git
synced 2025-08-08 15:47:00 +02:00
Fix shorten_utf8
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@920 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -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] ? "<em>...</em>" : "");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user