PostgreSQL: Upload binary files to bytea fields
This commit is contained in:
parent
b649fb2f3f
commit
17b110f0d5
|
@ -37,7 +37,11 @@ if (isset($_GET["pgsql"])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function quote($string) {
|
function quote($string) {
|
||||||
return "'" . pg_escape_string($this->_link, $string) . "'"; //! bytea
|
return "'" . pg_escape_string($this->_link, $string) . "'";
|
||||||
|
}
|
||||||
|
|
||||||
|
function quoteBinary($string) {
|
||||||
|
return "'" . pg_escape_bytea($this->_link, $string) . "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
function select_db($database) {
|
function select_db($database) {
|
||||||
|
@ -147,6 +151,10 @@ if (isset($_GET["pgsql"])) {
|
||||||
return ($adminer->database() == $database);
|
return ($adminer->database() == $database);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function quoteBinary($s) {
|
||||||
|
return q($s);
|
||||||
|
}
|
||||||
|
|
||||||
function warnings() {
|
function warnings() {
|
||||||
return ''; // not implemented in PDO_PgSQL as of PHP 7.2.1
|
return ''; // not implemented in PDO_PgSQL as of PHP 7.2.1
|
||||||
}
|
}
|
||||||
|
@ -188,6 +196,10 @@ if (isset($_GET["pgsql"])) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function quoteBinary($s) {
|
||||||
|
return $this->_conn->quoteBinary($s);
|
||||||
|
}
|
||||||
|
|
||||||
function warnings() {
|
function warnings() {
|
||||||
return $this->_conn->warnings();
|
return $this->_conn->warnings();
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,6 +123,14 @@
|
||||||
return $idf;
|
return $idf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Quote binary string
|
||||||
|
* @param string
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function quoteBinary($s) {
|
||||||
|
return q($s);
|
||||||
|
}
|
||||||
|
|
||||||
/** Get warnings about the last command
|
/** Get warnings about the last command
|
||||||
* @return string HTML
|
* @return string HTML
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1003,7 +1003,7 @@ function input($field, $value, $function) {
|
||||||
* @return string or false to leave the original value
|
* @return string or false to leave the original value
|
||||||
*/
|
*/
|
||||||
function process_input($field) {
|
function process_input($field) {
|
||||||
global $adminer;
|
global $adminer, $driver;
|
||||||
$idf = bracket_escape($field["field"]);
|
$idf = bracket_escape($field["field"]);
|
||||||
$function = $_POST["function"][$idf];
|
$function = $_POST["function"][$idf];
|
||||||
$value = $_POST["fields"][$idf];
|
$value = $_POST["fields"][$idf];
|
||||||
|
@ -1041,7 +1041,7 @@ function process_input($field) {
|
||||||
if (!is_string($file)) {
|
if (!is_string($file)) {
|
||||||
return false; //! report errors
|
return false; //! report errors
|
||||||
}
|
}
|
||||||
return q($file);
|
return $driver->quoteBinary($file);
|
||||||
}
|
}
|
||||||
return $adminer->processInput($field, $value, $function);
|
return $adminer->processInput($field, $value, $function);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
Adminer 4.6.1-dev:
|
Adminer 4.6.1-dev:
|
||||||
MySQL: Support non-utf8 charset in search in column
|
MySQL: Support non-utf8 charset in search in column
|
||||||
MySQL: Support geometry in MySQL 8 (bug #574)
|
MySQL: Support geometry in MySQL 8 (bug #574)
|
||||||
|
PostgreSQL: Upload binary files to bytea fields
|
||||||
PostgreSQL: Cast to string when searching using LIKE (bug #325)
|
PostgreSQL: Cast to string when searching using LIKE (bug #325)
|
||||||
PostgreSQL: Don't treat interval type as number (bug #474)
|
PostgreSQL: Don't treat interval type as number (bug #474)
|
||||||
PostgreSQL: Fix condition for selecting no rows
|
PostgreSQL: Fix condition for selecting no rows
|
||||||
|
|
Loading…
Reference in a new issue