mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
recovered. changes from 0b72571c7cb47056711365750f9035012ab88af6 [formerly f3a8cdd6923834443ed7223d1e6ad7776b861184]
Former-commit-id: 591e002043d2bae2382c8a91c437057fd2b809c7
This commit is contained in:
parent
27602d8e49
commit
37f6da9aa8
@ -706,6 +706,7 @@ function mysql_db_format_array_where_clause_sql($values, $join='AND', $prefix=fa
|
||||
$i = 1;
|
||||
$max = count($values);
|
||||
foreach ($values as $field => $value) {
|
||||
$negative = false;
|
||||
if (is_numeric($field)) {
|
||||
// User provide the exact operation to do
|
||||
$query .= $value;
|
||||
@ -718,6 +719,11 @@ function mysql_db_format_array_where_clause_sql($values, $join='AND', $prefix=fa
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($field[0] == '!') {
|
||||
$negative = true;
|
||||
$field = substr($field, 1);
|
||||
}
|
||||
|
||||
if ($field[0] != '`') {
|
||||
// If the field is as <table>.<field>, don't scape.
|
||||
if (strstr($field, '.') === false) {
|
||||
@ -732,7 +738,8 @@ function mysql_db_format_array_where_clause_sql($values, $join='AND', $prefix=fa
|
||||
} else if (is_float($value) || is_double($value)) {
|
||||
$query .= sprintf('%s = %f', $field, $value);
|
||||
} else if (is_array($value)) {
|
||||
$query .= sprintf('%s IN ("%s")', $field, implode('", "', $value));
|
||||
$not = $negative ? ' NOT ' : '';
|
||||
$query .= sprintf('%s %sIN ("%s")', $field, $not, implode('", "', $value));
|
||||
} else {
|
||||
if ($value === '') {
|
||||
// Search empty string
|
||||
|
Loading…
x
Reference in New Issue
Block a user