summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/inc/filter.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/statistics/inc/filter.inc.php')
-rw-r--r--modules-available/statistics/inc/filter.inc.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules-available/statistics/inc/filter.inc.php b/modules-available/statistics/inc/filter.inc.php
index f6765059..565ea5f0 100644
--- a/modules-available/statistics/inc/filter.inc.php
+++ b/modules-available/statistics/inc/filter.inc.php
@@ -18,7 +18,7 @@ class Filter
{
$this->column = trim($column);
$this->operator = trim($operator);
- $this->argument = trim($argument);
+ $this->argument = is_array($argument) ? $argument : trim($argument);
}
/* returns a where clause and adds needed operators to the passed array */
@@ -245,7 +245,12 @@ class LocationFilter extends Filter
$recursive = (substr($this->operator, -1) === '~');
$this->operator = str_replace('~', '=', $this->operator);
- settype($this->argument, 'int');
+ if (is_array($this->argument)) {
+ if ($recursive)
+ Util::traceError('Cannot use ~ operator for location with array');
+ } else {
+ settype($this->argument, 'int');
+ }
$neg = $this->operator === '=' ? '' : 'NOT';
if ($this->argument === 0) {
return "machine.locationid IS $neg NULL";