]> git.joonet.de Git - adminer.git/commitdiff
Move $error to Adminer::$error
authorJakub Vrana <jakub@vrana.cz>
Fri, 28 Mar 2025 18:10:40 +0000 (19:10 +0100)
committerJakub Vrana <jakub@vrana.cz>
Fri, 28 Mar 2025 18:48:23 +0000 (19:48 +0100)
adminer/include/bootstrap.inc.php
adminer/include/functions.inc.php

index d547739782e88ece39f81a6c45a5f0c29b7f2c98..dcb5bef1a273de6643f6f0418e7d168a881c1920 100644 (file)
@@ -39,7 +39,7 @@ if ($_GET["script"] == "version") {
        exit;
 }
 
-global $adminer, $connection, $driver, $drivers, $error, $permanent, $has_token, $translations; // allows including Adminer inside a function
+global $adminer, $connection, $driver, $drivers, $permanent, $has_token, $translations; // allows including Adminer inside a function
 
 if (!$_SERVER["REQUEST_URI"]) { // IIS 5 compatibility
        $_SERVER["REQUEST_URI"] = $_SERVER["ORIG_PATH_INFO"];
index 6771549f660f14b60de0a0181348a1b82befa8c9..beecaff72bdc16388dc34ea130a4cc9e02ad88e4 100644 (file)
@@ -435,18 +435,15 @@ function redirect(?string $location, string $message = null): void {
 * @param bool $redirect
 */
 function query_redirect(string $query, string $location, string $message, $redirect = true, bool $execute = true, bool $failed = false, string $time = ""): bool {
-       global $connection, $error, $adminer;
+       global $connection, $adminer;
        if ($execute) {
                $start = microtime(true);
                $failed = !$connection->query($query);
                $time = format_time($start);
        }
-       $sql = "";
-       if ($query) {
-               $sql = $adminer->messageQuery($query, $time, $failed);
-       }
+       $sql = ($query ? $adminer->messageQuery($query, $time, $failed) : "");
        if ($failed) {
-               $error = error() . $sql . script("messagesPrint();");
+               $adminer->error .= error() . $sql . script("messagesPrint();") . "<br>";
                return false;
        }
        if ($redirect) {