aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/dbal.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/db/dbal.php')
-rw-r--r--phpBB/includes/db/dbal.php13
1 files changed, 5 insertions, 8 deletions
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php
index 1fee674f80..d2d3efedaa 100644
--- a/phpBB/includes/db/dbal.php
+++ b/phpBB/includes/db/dbal.php
@@ -298,19 +298,16 @@ class dbal
$array = array($array);
}
- $values = array();
- foreach ($array as $var)
+ if (sizeof($array) == 1)
{
- $values[] = $this->_sql_validate_value($var);
- }
+ @reset($array);
+ $var = current($array);
- if (sizeof($values) == 1)
- {
- return $field . ($negate ? ' <> ' : ' = ') . $values[0];
+ return $field . ($negate ? ' <> ' : ' = ') . $this->_sql_validate_value($var);
}
else
{
- return $field . ($negate ? ' NOT IN ' : ' IN ' ) . '(' . implode(', ', $values) . ')';
+ return $field . ($negate ? ' NOT IN ' : ' IN ' ) . '(' . implode(', ', array_map(array($this, '_sql_validate_value'), $array)) . ')';
}
}