summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--inc/database.inc.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/inc/database.inc.php b/inc/database.inc.php
index 79c945b8..c1292cd8 100644
--- a/inc/database.inc.php
+++ b/inc/database.inc.php
@@ -213,6 +213,7 @@ class Database
*/
private static function handleArrayArgument(&$query, &$args)
{
+ $again = false;
foreach (array_keys($args) as $key) {
if (is_numeric($key) || $key === '?')
continue;
@@ -229,7 +230,12 @@ class Database
}
$new = array();
foreach ($args[$key] as $subIndex => $sub) {
- $new[] = $newkey . '_' . $subIndex;
+ if (is_array($sub)) {
+ $new[] = '(' . $newkey . '_' . $subIndex . ')';
+ $again = true;
+ } else {
+ $new[] = $newkey . '_' . $subIndex;
+ }
$args[$newkey . '_' . $subIndex] = $sub;
}
unset($args[$key]);
@@ -237,6 +243,9 @@ class Database
$query = preg_replace('/' . $newkey . '\b/', $new, $query);
}
}
+ if ($again) {
+ self::handleArrayArgument($query, $args);
+ }
}
/**