]> git.joonet.de Git - adminer.git/commitdiff
Shorten displayed SQL query
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 15 Jun 2009 08:36:30 +0000 (08:36 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 15 Jun 2009 08:36:30 +0000 (08:36 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@689 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/include/functions.inc.php
adminer/select.inc.php
adminer/sql.inc.php

index 9ef2b787ddeb8987a069fddeb88d04570cee95d2..cd774df85432b3d24342f8cfa953facd336f344e 100644 (file)
@@ -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] ? "<em>...</em>" : "");
+       return htmlspecialchars($match[1]) . ($match[2] ? "<em>...</em>" : "");
 }
 
 function friendly_url($val) {
index f35fa927ec978090ca5b68d38f719e4731b8198b..bbf8e275ea49b418f5469bc0ae94f17d190f22eb 100644 (file)
@@ -253,7 +253,7 @@ if (!$columns) {
                                                if (!strlen(trim($val))) {
                                                        $val = "&nbsp;";
                                                } 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") {
index f350c2403916b4d5071577d7f1c6e8bda289c0e5..8e5b81afdf24d43ffdec974ca954b6aca9daad70 100644 (file)
@@ -24,7 +24,7 @@ if (!$error && $_POST) {
                                        $offset = $match[0][1] + strlen($match[0][0]);
                                } else {
                                        $empty = false;
-                                       echo "<pre class='jush-sql'>" . htmlspecialchars(trim(substr($query, 0, $match[0][1]))) . "</pre>\n";
+                                       echo "<pre class='jush-sql'>" . shorten_utf8(trim(substr($query, 0, $match[0][1])), 100) . "</pre>\n";
                                        flush();
                                        $start = explode(" ", microtime());
                                        //! don't allow changing of character_set_results, convert encoding of displayed query