1
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2025-07-31 10:04:20 +03:00

try and fix #30 - cope with timestamp and numeric field number comparison better for PostgreSQL.

This commit is contained in:
David Goodwin
2018-09-07 11:04:19 +01:00
parent afd418675c
commit 1e158245d6

View File

@ -2039,7 +2039,13 @@ function db_where_clause($condition, $struct, $additional_raw_where = '', $searc
} elseif ($operator == "NOTNULL") {
$querypart = $field . ' IS NOT NULL';
} else {
$querypart = $field . $operator . "'" . escape_string($value) . "'";
// might need other types adding here.
if (db_pgsql() && in_array($struct[$field]['type'], array('ts', 'num')) && $value === '') {
$querypart = $field . $operator . " NULL";
}
}
if (!empty($struct[$field]['select'])) {