diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 9ef2b787..cd774df8 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -232,7 +232,7 @@ function is_utf8($val) { function shorten_utf8($string, $length) { preg_match("~^(.{0,$length})(.?)~su", $string, $match); - return nl2br(htmlspecialchars($match[1])) . ($match[2] ? "..." : ""); + return htmlspecialchars($match[1]) . ($match[2] ? "..." : ""); } function friendly_url($val) { diff --git a/adminer/select.inc.php b/adminer/select.inc.php index f35fa927..bbf8e275 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -253,7 +253,7 @@ if (!$columns) { if (!strlen(trim($val))) { $val = " "; } elseif (intval($text_length) > 0 && preg_match('~blob|text~', $fields[$key]["type"])) { - $val = shorten_utf8($val, intval($text_length)); + $val = nl2br(shorten_utf8($val, intval($text_length))); } else { $val = nl2br(htmlspecialchars($val)); if ($fields[$key]["type"] == "char") { diff --git a/adminer/sql.inc.php b/adminer/sql.inc.php index f350c240..8e5b81af 100644 --- a/adminer/sql.inc.php +++ b/adminer/sql.inc.php @@ -24,7 +24,7 @@ if (!$error && $_POST) { $offset = $match[0][1] + strlen($match[0][0]); } else { $empty = false; - echo "
" . htmlspecialchars(trim(substr($query, 0, $match[0][1]))) . "\n"; + echo "
" . shorten_utf8(trim(substr($query, 0, $match[0][1])), 100) . "\n"; flush(); $start = explode(" ", microtime()); //! don't allow changing of character_set_results, convert encoding of displayed query