From 5751666f451bd500635f5375081ef7059f8f6e58 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Wed, 10 Jun 2015 17:39:46 +0200 Subject: [PATCH] Improved the function "oracle_db_format_array_where_clause_sql" by adding more checks --- pandora_console/include/db/oracle.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/db/oracle.php b/pandora_console/include/db/oracle.php index eac475f8af..acb69eb6ea 100644 --- a/pandora_console/include/db/oracle.php +++ b/pandora_console/include/db/oracle.php @@ -654,16 +654,28 @@ function oracle_db_format_array_where_clause_sql ($values, $join = 'AND', $prefi else { if ($value[0] == ">") { $value = substr($value,1,strlen($value)-1); - $query .= sprintf ("%s > '%s'", $field, $value); + + if (is_nan($value)) + $query .= sprintf ("%s > '%s'", $field, $value); + else + $query .= sprintf ("%s > %s", $field, $value); } else if ($value[0] == "<") { if ($value[1] == ">") { $value = substr($value,2,strlen($value)-2); - $query .= sprintf ("%s <> '%s'", $field, $value); + + if (is_nan($value)) + $query .= sprintf ("%s <> '%s'", $field, $value); + else + $query .= sprintf ("%s <> %s", $field, $value); } else { $value = substr($value,1,strlen($value)-1); - $query .= sprintf ("%s < '%s'", $field, $value); + + if (is_nan($value)) + $query .= sprintf ("%s < '%s'", $field, $value); + else + $query .= sprintf ("%s < %s", $field, $value); } } else if ($value[0] == '%') {