From 473f7264f8f61b3009e5b2c5c7103fddff764ad3 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sun, 23 May 2021 11:08:29 +0200 Subject: [PATCH] PostgreSQL: Use separator in limit1 --- adminer/drivers/pgsql.inc.php | 2 +- adminer/select.inc.php | 2 +- changes.txt | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/adminer/drivers/pgsql.inc.php b/adminer/drivers/pgsql.inc.php index caeda875..d99efdd1 100644 --- a/adminer/drivers/pgsql.inc.php +++ b/adminer/drivers/pgsql.inc.php @@ -284,7 +284,7 @@ if (isset($_GET["pgsql"])) { function limit1($table, $query, $where, $separator = "\n") { return (preg_match('~^INTO~', $query) ? limit($query, $where, 1, 0, $separator) - : " $query" . (is_view(table_status1($table)) ? $where : " WHERE ctid = (SELECT ctid FROM " . table($table) . $where . $separator . "LIMIT 1)") + : " $query" . (is_view(table_status1($table)) ? $where : $separator . "WHERE ctid = (SELECT ctid FROM " . table($table) . $where . $separator . "LIMIT 1)") ); } diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 5a40aeff..d213ae96 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -382,7 +382,7 @@ if (!$columns && support("table")) { $key = "MD5(" . ($jush != 'sql' || preg_match("~^utf8~", $fields[$key]["collation"]) ? $key : "CONVERT($key USING " . charset($connection) . ")") . ")"; $val = md5($val); } - $unique_idf .= "&" . ($val !== null ? urlencode("where[" . bracket_escape($key) . "]") . "=" . urlencode($val) : "null%5B%5D=" . urlencode($key)); + $unique_idf .= "&" . ($val !== null ? urlencode("where[" . bracket_escape($key) . "]") . "=" . urlencode($val === false ? "f" : $val) : "null%5B%5D=" . urlencode($key)); } echo "" . (!$group && $select ? "" : "" . checkbox("check[]", substr($unique_idf, 1), in_array(substr($unique_idf, 1), (array) $_POST["check"])) diff --git a/changes.txt b/changes.txt index aa8a7cf2..d5c4c5f6 100644 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,6 @@ Adminer 4.8.2-dev: MySQL: Use ST_SRID() instead of SRID() for MySQL 8 (PR #418) +PostgreSQL PDO: Allow editing rows identified by boolean column (PR #380) Adminer 4.8.1 (released 2021-05-14): Internet Explorer or PDO in Adminer 4.7.8-4.8.0: Fix XSS in doc_link (bug #797)