Skip to content

Commit

Permalink
Store only 1MB of history
Browse files Browse the repository at this point in the history
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1327 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information
jakubvrana committed Feb 24, 2010
1 parent 3fc5d28 commit 2159590
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion adminer/include/adminer.inc.php
Expand Up @@ -379,7 +379,7 @@ function selectEmailProcess($where, $foreignKeys) {
function messageQuery($query) {
restart_session();
$id = "sql-" . count($_SESSION["messages"]);
$_SESSION["history"][$_GET["server"]][DB][] = $query;
$_SESSION["history"][$_GET["server"]][DB][] = (strlen($query) > 1e6 ? ereg_replace('[\x80-\xFF]+$', '', substr($query, 0, 1e6)) . "\n..." : $query); // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment
return " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><div id='$id' class='hidden'><pre class='jush-sql'>" . shorten_utf8($query, 1000) . '</pre><a href="' . h(ME . 'sql=&history=' . (count($_SESSION["history"][$_GET["server"]][DB]) - 1)) . '">' . lang('Edit') . '</a></div>';
}

Expand Down

0 comments on commit 2159590

Please sign in to comment.