Skip to content

Commit

Permalink
PostgreSQL: Use separator in limit1
Browse files Browse the repository at this point in the history
  • Loading branch information
vrana committed May 23, 2021
1 parent db01282 commit 473f726
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion adminer/drivers/pgsql.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ function limit($query, $where, $limit, $offset = 0, $separator = " ") {
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)")
);
}

Expand Down
2 changes: 1 addition & 1 deletion adminer/select.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@
$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 "<tr" . odd() . ">" . (!$group && $select ? "" : "<td>"
. checkbox("check[]", substr($unique_idf, 1), in_array(substr($unique_idf, 1), (array) $_POST["check"]))
Expand Down
1 change: 1 addition & 0 deletions changes.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 473f726

Please sign in to comment.