1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-21 21:55:43 +02:00

PostgreSQL: Don't treat interval type as number (bug #474)

This commit is contained in:
Jakub Vrana
2018-02-06 12:17:01 +01:00
parent 11a7fc0277
commit 6cfb3676a7
8 changed files with 20 additions and 10 deletions

View File

@@ -197,7 +197,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
if ($link) {
$return = "<a href='$link'" . (is_url($link) ? target_blank() : "") . ">$return</a>";
}
if (!$link && !like_bool($field) && preg_match('~int|float|double|decimal~', $field["type"])) {
if (!$link && !like_bool($field) && preg_match('~' . number_type() . '~', $field["type"])) {
$return = "<div class='number'>$return</div>"; // Firefox doesn't support <colgroup>
} elseif (preg_match('~date~', $field["type"])) {
$return = "<div class='datetime'>$return</div>";
@@ -342,7 +342,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
if (($key < 0 ? "" : $col) . $val != "") {
$conds = array();
foreach (($col != "" ? array($col => $fields[$col]) : $fields) as $name => $field) {
if ($col != "" || is_numeric($val) || !preg_match('~int|float|double|decimal~', $field["type"])) {
if ($col != "" || is_numeric($val) || !preg_match('~' . number_type() . '~', $field["type"])) {
$name = idf_escape($name);
if ($col != "" && $field["type"] == "enum") {
$conds[] = (in_array(0, $val) ? "$name IS NULL OR " : "") . "$name IN (" . implode(", ", array_map('intval', $val)) . ")";