diff --git a/pandora_console/include/db/mysql.php b/pandora_console/include/db/mysql.php index fdcf2ba403..5c65c5dff1 100644 --- a/pandora_console/include/db/mysql.php +++ b/pandora_console/include/db/mysql.php @@ -760,7 +760,11 @@ function mysql_db_format_array_where_clause_sql($values, $join='AND', $prefix=fa if ($field[0] != '`') { // If the field is as ., don't scape. if (strstr($field, '.') === false) { - $field = '`'.$field.'`'; + if (preg_match('/(UPPER|LOWER)(.+)/mi', $field)) { + $field = preg_replace('/(UPPER|LOWER])\((.+)\)/mi', '$1(`$2`)', $field); + } else { + $field = '`'.$field.'`'; + } } }