[icinga-checkins] icinga.org: icingaweb2/master: Fix filter expression handling when lowering to achieve case-insensitivity

git at icinga.org git at icinga.org
Mon Feb 16 13:05:34 CET 2015


Module: icingaweb2
Branch: master
Commit: e588ea2714db6c4e6e307590bbbf5ca6e306f8ef
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=e588ea2714db6c4e6e307590bbbf5ca6e306f8ef

Author: Johannes Meyer <johannes.meyer at netways.de>
Date:   Mon Feb 16 13:05:24 2015 +0100

Fix filter expression handling when lowering to achieve case-insensitivity

fixes #8435

---

 .../library/Monitoring/Backend/Ido/Query/IdoQuery.php           |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php
index a2c7578..c87025f 100644
--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php
@@ -290,7 +290,12 @@ abstract class IdoQuery extends DbQuery
                 && strpos($filter->getColumn(), 'LOWER') !== 0
             ) {
                 $filter->setColumn('LOWER(' . $filter->getColumn() . ')');
-                $filter->setExpression(strtolower($filter->getExpression()));
+                $expression = $filter->getExpression();
+                if (is_array($expression)) {
+                    $filter->setExpression(array_map('strtolower', $expression));
+                } else {
+                    $filter->setExpression(strtolower($expression));
+                }
             }
         } else {
             foreach ($filter->filters() as $chainedFilter) {



More information about the icinga-checkins mailing list