From 35c8c6baa4485a904e5f80a9b25c415aa0cb1c02 Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Thu, 23 Jul 2009 17:28:29 +0000 Subject: [PATCH] Respect zero text length git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@889 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- adminer/select.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 8831b8b0..af1b09dc 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -245,7 +245,7 @@ if (!$columns) { if (isset($text_length)) { echo "
" . lang('Text length') . "
"; - echo ""; + echo ''; echo "
\n"; } @@ -317,8 +317,8 @@ if (!$columns) { } else { if (!strlen(trim($val, " \t"))) { $val = " "; - } elseif (intval($text_length) > 0 && ereg('blob|text', $fields[$key]["type"])) { - $val = nl2br(shorten_utf8($val, intval($text_length))); // usage of LEFT() would reduce traffic but complicates query + } elseif (strlen($text_length) && ereg('blob|text', $fields[$key]["type"])) { + $val = nl2br(shorten_utf8($val, max(0, intval($text_length)))); // usage of LEFT() would reduce traffic but complicate query } else { $val = nl2br(htmlspecialchars($val)); if ($fields[$key]["type"] == "char") {