From 9ea8f44919bea61a74232f1c8e2360e750bad0c8 Mon Sep 17 00:00:00 2001 From: Peter Knut Date: Wed, 18 Sep 2024 00:46:34 +0200 Subject: [PATCH] Fix undefined property in error message if driver does not support error number --- adminer/sql.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adminer/sql.inc.php b/adminer/sql.inc.php index 48d85d25..1794aaa1 100644 --- a/adminer/sql.inc.php +++ b/adminer/sql.inc.php @@ -123,7 +123,7 @@ if (!$error && $_POST) { if ($connection->error) { echo ($_POST["only_errors"] ? $print : ""); - echo "

" . lang('Error in query') . ($connection->errno ? " ($connection->errno)" : "") . ": " . error() . "\n"; + echo "

" . lang('Error in query') . (!empty($connection->errno) ? " ($connection->errno)" : "") . ": " . error() . "\n"; $errors[] = " $commands"; if ($_POST["error_stops"]) { break 2; @@ -225,7 +225,7 @@ if (!isset($_GET["import"])) { echo script(($_POST ? "" : "qs('textarea').focus();\n") . "qs('#form').onsubmit = partial(sqlSubmit, qs('#form'), '" . js_escape(remove_from_uri("sql|limit|error_stops|only_errors|history")) . "');"); echo "

$execute\n"; echo lang('Limit rows') . ": \n"; - + } else { echo "

" . lang('File upload') . "
"; $gz = (extension_loaded("zlib") ? "[.gz]" : "");