From: Jakub Vrana Date: Mon, 20 Feb 2017 15:22:30 +0000 (+0100) Subject: Support high Unicode characters in shorten_utf8 (bug #481) X-Git-Tag: v4.3.0~26 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=63b6b99365cde762364238ca7a81d028525b2ef6;p=adminer.git Support high Unicode characters in shorten_utf8 (bug #481) --- 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]) ? "" : "...");