From 63b6b99365cde762364238ca7a81d028525b2ef6 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 20 Feb 2017 16:22:30 +0100 Subject: [PATCH] Support high Unicode characters in shorten_utf8 (bug #481) --- adminer/include/functions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index ee861f06..97027f65 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -750,7 +750,7 @@ function is_utf8($val) { * @return string escaped string with appended ... */ function shorten_utf8($string, $length = 80, $suffix = "") { - if (!preg_match("(^(" . repeat_pattern("[\t\r\n -\x{FFFF}]", $length) . ")($)?)u", $string, $match)) { // ~s causes trash in $match[2] under some PHP versions, (.|\n) is slow + if (!preg_match("(^(" . repeat_pattern("[\t\r\n -\x{10FFFF}]", $length) . ")($)?)u", $string, $match)) { // ~s causes trash in $match[2] under some PHP versions, (.|\n) is slow preg_match("(^(" . repeat_pattern("[\t\r\n -~]", $length) . ")($)?)", $string, $match); } return h($match[1]) . $suffix . (isset($match[2]) ? "" : "..."); -- 2.39.5