1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-14 02:23:59 +02:00

PostgreSQL PDO: Escape bytea values (bug #218)

This commit is contained in:
Jakub Vrana
2025-03-11 19:26:21 +01:00
parent c2d29a6937
commit a94a727af7
2 changed files with 2 additions and 9 deletions

View File

@@ -50,10 +50,6 @@ if (isset($_GET["pgsql"])) {
return ($field["type"] == "bytea" && $val !== null ? pg_unescape_bytea($val) : $val);
}
function quoteBinary($string) {
return "'" . pg_escape_bytea($this->link, $string) . "'";
}
function select_db($database) {
global $adminer;
if ($database == $adminer->database()) {
@@ -173,10 +169,6 @@ if (isset($_GET["pgsql"])) {
return ($adminer->database() == $database);
}
function quoteBinary($s) {
return q($s);
}
function query($query, $unbuffered = false) {
$return = parent::query($query, $unbuffered);
if ($this->timeout) {
@@ -283,7 +275,7 @@ if (isset($_GET["pgsql"])) {
}
function quoteBinary($s) {
return $this->conn->quoteBinary($s);
return "'\\x" . bin2hex($s) . "'"; // available since PostgreSQL 8.1
}
function warnings() {