1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-18 20:31:19 +02:00

Minimize the chance of displaying message on different page (thanks to Tomas Brukner)

This commit is contained in:
Jakub Vrana
2011-01-30 20:37:22 +01:00
parent ceef6bc6d3
commit 79fa7dab3b
4 changed files with 9 additions and 6 deletions

View File

@@ -404,8 +404,9 @@ username.form['driver'].onchange();
*/
function messageQuery($query) {
global $jush;
static $count = 0;
restart_session();
$id = "sql-" . count($_SESSION["messages"]);
$id = "sql-" . ($count++);
$history = &get_session("queries");
$history[$_GET["db"]][] = (strlen($query) > 1e6 // not DB - reset in drop database
? ereg_replace('[\x80-\xFF]+$', '', substr($query, 0, 1e6)) . "\n..." // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment