Private GIT

Skip to content
Snippets Groups Projects
Commit 75e937ae authored by Jean-Baptiste's avatar Jean-Baptiste Committed by loiclau
Browse files

Compatibility with PHP version 5.3 (#5976)

'asort' with SORT_NATURAL was added only in PHP version 5.4.
parent 8b649b12
Branches
No related tags found
No related merge requests found
......@@ -122,7 +122,6 @@ function get_notified_infos_for_host($hostId)
$stopReading['contactGroups'] = 1;
}
if ($stopReading['contacts'] == 1 && $stopReading['contactGroups'] == 1) {
break;
}
......@@ -142,8 +141,14 @@ function get_notified_infos_for_host($hostId)
$stack = array_merge($hostsTpl, $stack);
}
if (version_compare(phpversion(), '5.4.0') >= 0){
asort($results['contacts'], SORT_NATURAL | SORT_FLAG_CASE);
asort($results['contactGroups'], SORT_NATURAL | SORT_FLAG_CASE);
} else {
natcasesort($results['contacts']);
natcasesort($results['contactGroups']);
}
return $results;
}
......@@ -237,8 +242,14 @@ function get_notified_infos_for_service($serviceId, $hostId)
return get_notified_infos_for_host($hostId);
}
if (version_compare(phpversion(), '5.4.0') >= 0){
asort($results['contacts'], SORT_NATURAL | SORT_FLAG_CASE);
asort($results['contactGroups'], SORT_NATURAL | SORT_FLAG_CASE);
} else {
natcasesort($results['contacts']);
natcasesort($results['contactGroups']);
}
return $results;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment