[icinga-checkins] icinga.org: icingaweb2/feature/setup-wizard-7163: Data\Filter: SORT_NATURAL only for PHP >= 5.4

git at icinga.org git at icinga.org
Wed Nov 12 14:53:42 CET 2014


Module: icingaweb2
Branch: feature/setup-wizard-7163
Commit: f0ca81d7af6d7cb0b777877e786f26e637b60821
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=f0ca81d7af6d7cb0b777877e786f26e637b60821

Author: Thomas Gelf <thomas at gelf.net>
Date:   Wed Nov 12 11:47:42 2014 +0100

Data\Filter: SORT_NATURAL only for PHP >= 5.4

---

 library/Icinga/Data/Filter/Filter.php |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/library/Icinga/Data/Filter/Filter.php b/library/Icinga/Data/Filter/Filter.php
index 64607a4..99b0290 100644
--- a/library/Icinga/Data/Filter/Filter.php
+++ b/library/Icinga/Data/Filter/Filter.php
@@ -79,7 +79,7 @@ abstract class Filter
             }
         }
 
-        krsort($operators, SORT_NATURAL);
+        krsort($operators, version_compare(PHP_VERSION, '5.4.0') >= 0 ? SORT_NATURAL : SORT_REGULAR);
         foreach ($operators as $id => $operator) {
             $f = $filter->getById($id);
             if ($f->getOperatorName() !== $operator) {



More information about the icinga-checkins mailing list