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

Move $token to get_token()

This commit is contained in:
Jakub Vrana
2025-03-28 18:49:26 +01:00
parent 74457f0895
commit e219ef9ad1
7 changed files with 10 additions and 13 deletions

View File

@@ -850,7 +850,7 @@ function count_rows(string $table, array $where, bool $is_group, array $group):
* @return string[]
*/
function slow_query(string $query): array {
global $adminer, $token, $driver;
global $adminer, $driver;
$db = $adminer->database();
$timeout = $adminer->queryTimeout();
$slow_query = $driver->slowQuery($query, $timeout);
@@ -859,7 +859,7 @@ function slow_query(string $query): array {
$connection2 = connect($adminer->credentials());
if (is_object($connection2) && ($db == "" || $connection2->select_db($db))) {
$kill = get_val(connection_id(), 0, $connection2); // MySQL and MySQLi can use thread_id but it's not in PDO_MySQL
echo script("const timeout = setTimeout(() => { ajax('" . js_escape(ME) . "script=kill', function () {}, 'kill=$kill&token=$token'); }, 1000 * $timeout);");
echo script("const timeout = setTimeout(() => { ajax('" . js_escape(ME) . "script=kill', function () {}, 'kill=$kill&token=" . get_token() . "'); }, 1000 * $timeout);");
}
}
ob_flush();