PostgreSQL: Unescape bytea fields
This commit is contained in:
parent
29c127e94a
commit
19653de764
|
@ -6,5 +6,5 @@ header("Content-Disposition: attachment; filename=" . friendly_url("$TABLE-" . i
|
||||||
$select = array(idf_escape($_GET["field"]));
|
$select = array(idf_escape($_GET["field"]));
|
||||||
$result = $driver->select($TABLE, $select, array(where($_GET, $fields)), $select);
|
$result = $driver->select($TABLE, $select, array(where($_GET, $fields)), $select);
|
||||||
$row = ($result ? $result->fetch_row() : array());
|
$row = ($result ? $result->fetch_row() : array());
|
||||||
echo $row[0];
|
echo $driver->value($row[0], $fields[$_GET["field"]]);
|
||||||
exit; // don't output footer
|
exit; // don't output footer
|
||||||
|
|
|
@ -40,6 +40,10 @@ if (isset($_GET["pgsql"])) {
|
||||||
return "'" . pg_escape_string($this->_link, $string) . "'";
|
return "'" . pg_escape_string($this->_link, $string) . "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function value($val, $field) {
|
||||||
|
return ($field["type"] == "bytea" ? pg_unescape_bytea($val) : $val);
|
||||||
|
}
|
||||||
|
|
||||||
function quoteBinary($string) {
|
function quoteBinary($string) {
|
||||||
return "'" . pg_escape_bytea($this->_link, $string) . "'";
|
return "'" . pg_escape_bytea($this->_link, $string) . "'";
|
||||||
}
|
}
|
||||||
|
@ -151,6 +155,10 @@ if (isset($_GET["pgsql"])) {
|
||||||
return ($adminer->database() == $database);
|
return ($adminer->database() == $database);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function value($val, $field) {
|
||||||
|
return $val;
|
||||||
|
}
|
||||||
|
|
||||||
function quoteBinary($s) {
|
function quoteBinary($s) {
|
||||||
return q($s);
|
return q($s);
|
||||||
}
|
}
|
||||||
|
@ -196,6 +204,10 @@ if (isset($_GET["pgsql"])) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function value($val, $field) {
|
||||||
|
return $this->_conn->value($val, $field);
|
||||||
|
}
|
||||||
|
|
||||||
function quoteBinary($s) {
|
function quoteBinary($s) {
|
||||||
return $this->_conn->quoteBinary($s);
|
return $this->_conn->quoteBinary($s);
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,7 +122,16 @@
|
||||||
function convertSearch($idf, $val, $field) {
|
function convertSearch($idf, $val, $field) {
|
||||||
return $idf;
|
return $idf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Convert value returned by database to actual value
|
||||||
|
* @param string
|
||||||
|
* @param array
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function value($val, $field) {
|
||||||
|
return $val;
|
||||||
|
}
|
||||||
|
|
||||||
/** Quote binary string
|
/** Quote binary string
|
||||||
* @param string
|
* @param string
|
||||||
* @return string
|
* @return string
|
||||||
|
|
|
@ -391,6 +391,7 @@ if (!$columns && support("table")) {
|
||||||
foreach ($row as $key => $val) {
|
foreach ($row as $key => $val) {
|
||||||
if (isset($names[$key])) {
|
if (isset($names[$key])) {
|
||||||
$field = $fields[$key];
|
$field = $fields[$key];
|
||||||
|
$val = $driver->value($val, $field);
|
||||||
if ($val != "" && (!isset($email_fields[$key]) || $email_fields[$key] != "")) {
|
if ($val != "" && (!isset($email_fields[$key]) || $email_fields[$key] != "")) {
|
||||||
$email_fields[$key] = (is_mail($val) ? $names[$key] : ""); //! filled e-mails can be contained on other pages
|
$email_fields[$key] = (is_mail($val) ? $names[$key] : ""); //! filled e-mails can be contained on other pages
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +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: Support binary files in 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