mirror of
https://github.com/vrana/adminer.git
synced 2025-08-08 15:47:00 +02:00
Move $error to Adminer::$error
This commit is contained in:
@@ -39,7 +39,7 @@ if ($_GET["script"] == "version") {
|
|||||||
exit;
|
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
|
if (!$_SERVER["REQUEST_URI"]) { // IIS 5 compatibility
|
||||||
$_SERVER["REQUEST_URI"] = $_SERVER["ORIG_PATH_INFO"];
|
$_SERVER["REQUEST_URI"] = $_SERVER["ORIG_PATH_INFO"];
|
||||||
|
@@ -435,18 +435,15 @@ function redirect(?string $location, string $message = null): void {
|
|||||||
* @param bool $redirect
|
* @param bool $redirect
|
||||||
*/
|
*/
|
||||||
function query_redirect(string $query, string $location, string $message, $redirect = true, bool $execute = true, bool $failed = false, string $time = ""): bool {
|
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) {
|
if ($execute) {
|
||||||
$start = microtime(true);
|
$start = microtime(true);
|
||||||
$failed = !$connection->query($query);
|
$failed = !$connection->query($query);
|
||||||
$time = format_time($start);
|
$time = format_time($start);
|
||||||
}
|
}
|
||||||
$sql = "";
|
$sql = ($query ? $adminer->messageQuery($query, $time, $failed) : "");
|
||||||
if ($query) {
|
|
||||||
$sql = $adminer->messageQuery($query, $time, $failed);
|
|
||||||
}
|
|
||||||
if ($failed) {
|
if ($failed) {
|
||||||
$error = error() . $sql . script("messagesPrint();");
|
$adminer->error .= error() . $sql . script("messagesPrint();") . "<br>";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($redirect) {
|
if ($redirect) {
|
||||||
|
Reference in New Issue
Block a user