## Adminer dev
- Fix search anywhere (bug #1004, regression from 5.1.1)
- Fix import without primary key (bug #1017, regression from 5.1.1)
+- PostgreSQL PDO: Fix bytea without primary key (bug #1021)
## Adminer 5.2.0 (released 2025-04-08)
- Autocomplete SQL commands
* @param Field $field
*/
function value(?string $val, array $field): ?string {
- return (method_exists($this->conn, 'value')
- ? $this->conn->value($val, $field)
- : (is_resource($val) ? stream_get_contents($val) : $val)
- );
+ return (method_exists($this->conn, 'value') ? $this->conn->value($val, $field) : $val);
}
/** Quote binary string */
public $_offset = 0, $num_rows;
function fetch_assoc() {
- return $this->fetch(\PDO::FETCH_ASSOC);
+ return $this->fetch_array(\PDO::FETCH_ASSOC);
}
function fetch_row() {
- return $this->fetch(\PDO::FETCH_NUM);
+ return $this->fetch_array(\PDO::FETCH_NUM);
+ }
+
+ private function fetch_array(int $mode) {
+ $return = $this->fetch($mode);
+ return ($return ? array_map(array($this, 'unresource'), $return) : $return);
+ }
+
+ private function unresource($val) {
+ return (is_resource($val) ? stream_get_contents($val) : $val);
}
function fetch_field(): \stdClass {