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

Avoid count(null)

This commit is contained in:
Jakub Vrana
2018-01-16 16:22:24 +01:00
parent 9ca92309a1
commit 0268aba85a
5 changed files with 7 additions and 3 deletions

View File

@@ -592,6 +592,9 @@ class Adminer {
global $jush;
restart_session();
$history = &get_session("queries");
if (!$history[$_GET["db"]]) {
$history[$_GET["db"]] = array();
}
$id = "sql-" . count($history[$_GET["db"]]);
if (strlen($query) > 1e6) {
$query = preg_replace('~[\x80-\xFF]+$~', '', substr($query, 0, 1e6)) . "\n..."; // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment