PostgreSQL: Display all SQL command warnings and only once

This commit is contained in:
Jakub Vrana
2026-02-10 19:07:12 +01:00
parent 38a937d966
commit fb1b76e411
3 changed files with 9 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
- Select: Disable Ctrl+click inline edit without UPDATE privilege
- Export: Remember unchecked objects (regression from 5.0.6)
- PostgreSQL: Order NULL last
- PostgreSQL: Display all SQL command warnings and only once
## Adminer 5.4.2 (released 2026-02-08)
- Avoid denial-of-service via version check (GHSA-q4f2-39gr-45jh, regression from 4.6.2)

View File

@@ -88,7 +88,13 @@ if (isset($_GET["pgsql"])) {
}
function warnings() {
return h(pg_last_notice($this->link)); // second parameter is available since PHP 7.1.0
if (PHP_VERSION_ID >= 70100) {
$return = implode("\n", pg_last_notice($this->link, 2)); // 2 - PGSQL_NOTICE_ALL
pg_last_notice($this->link, 3); // 3 - PGSQL_NOTICE_CLEAR
} else {
$return = pg_last_notice($this->link);
}
return nl_br(h($return));
}
/** Copy from array into a table

View File

@@ -22,6 +22,7 @@ parameters:
- "~expects bool~" # truthy values
- "~fread expects int<1, max>, 100000~" # 1e6
- "~'strlen' given~" # used as a bool callback
- "~between int<70100~" # PHP_VERSION_ID check
-
message: "~ type specified~" # duplicate functions and methods