diff options
author | Simon Rettberg | 2019-01-21 14:50:48 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-01-21 14:50:48 +0100 |
commit | 452bd74b291e63bcb0d84b118633e2a26852191c (patch) | |
tree | 92066af66505f29fcc4a49201d23a98663c4f789 /modules-available/statistics/inc | |
parent | [serversetup-bwlp] Fix saving default; add missing lang tag (diff) | |
parent | [statistics] Log if client seems to have crashed (diff) | |
download | slx-admin-452bd74b291e63bcb0d84b118633e2a26852191c.tar.gz slx-admin-452bd74b291e63bcb0d84b118633e2a26852191c.tar.xz slx-admin-452bd74b291e63bcb0d84b118633e2a26852191c.zip |
Merge branch 'master' into ipxe
Diffstat (limited to 'modules-available/statistics/inc')
-rw-r--r-- | modules-available/statistics/inc/filter.inc.php | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/modules-available/statistics/inc/filter.inc.php b/modules-available/statistics/inc/filter.inc.php index 565ea5f0..3ccea2c3 100644 --- a/modules-available/statistics/inc/filter.inc.php +++ b/modules-available/statistics/inc/filter.inc.php @@ -187,20 +187,24 @@ class Id44Filter extends Filter public function whereClause(&$args, &$joins) { global $SIZE_ID44; - $lower = floor(Page_Statistics::findBestValue($SIZE_ID44, $this->argument, false) * 1024 - 100); - $upper = ceil(Page_Statistics::findBestValue($SIZE_ID44, $this->argument, true) * 1024 + 100); + if ($this->operator === '=' || $this->operator === '!=') { + $lower = floor(Page_Statistics::findBestValue($SIZE_ID44, $this->argument, false) * 1024 - 100); + $upper = ceil(Page_Statistics::findBestValue($SIZE_ID44, $this->argument, true) * 1024 + 100); + } else { + $lower = $upper = round($this->argument * 1024); + } - if ($this->operator == '=') { + if ($this->operator === '=') { return " id44mb BETWEEN $lower AND $upper"; - } elseif ($this->operator == '!=') { + } elseif ($this->operator === '!=') { return " id44mb < $lower OR id44mb > $upper"; - } elseif ($this->operator == '<=') { - return " id44mb < $upper"; - } elseif ($this->operator == '>=') { - return " id44mb > $lower"; - } elseif ($this->operator == '<') { + } elseif ($this->operator === '<=') { + return " id44mb <= $upper"; + } elseif ($this->operator === '>=') { + return " id44mb >= $lower"; + } elseif ($this->operator === '<') { return " id44mb < $lower"; - } elseif ($this->operator == '>') { + } elseif ($this->operator === '>') { return " id44mb > $upper"; } else { error_log("unimplemented operator in Id44Filter: $this->operator"); |