diff --git a/library/Icinga/Data/BaseQuery.php b/library/Icinga/Data/BaseQuery.php index ef25cd9eaa..ff66adedf0 100644 --- a/library/Icinga/Data/BaseQuery.php +++ b/library/Icinga/Data/BaseQuery.php @@ -472,7 +472,7 @@ protected function parseFilterExpression($expression, $parameter = null) Node::createOperatorNode($splitted[0], $splitted[1], is_string($parameter)); return Node::createOperatorNode(Node::OPERATOR_EQUALS, $splitted[0], $parameter); } elseif (count($splitted) === 3) { - if (trim($splitted[2]) === '?' && is_string($parameter)) { + if (trim($splitted[2]) === '?') { return Node::createOperatorNode($splitted[1], $splitted[0], $parameter); } else { return Node::createOperatorNode($splitted[1], $splitted[0], $splitted[2]); diff --git a/library/Icinga/Data/Db/TreeToSqlParser.php b/library/Icinga/Data/Db/TreeToSqlParser.php index aed6c0f4d2..92b42c356d 100644 --- a/library/Icinga/Data/Db/TreeToSqlParser.php +++ b/library/Icinga/Data/Db/TreeToSqlParser.php @@ -168,7 +168,7 @@ private function addValueToQuery(Node $node, $query) { if ($this->query->isTimestamp($node->left)) { $node->context = Node::CONTEXT_TIMESTRING; } - if ($node->context === Node::CONTEXT_TIMESTRING) { + if ($node->context === Node::CONTEXT_TIMESTRING && !is_numeric($value)) { $value = strtotime($value); } $values[] = $this->query->getDatasource()->getConnection()->quote($value);