From b043317fd49b426d7bf8ef09ae5c5ac38ce90dd5 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Wed, 27 Jan 2016 15:53:27 +0100 Subject: [PATCH] PHP7: Fix Only variables should be passed by reference exception in Translator refs #10251 --- library/Icinga/Util/Translator.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Util/Translator.php b/library/Icinga/Util/Translator.php index eba2f8940..2ebea8751 100644 --- a/library/Icinga/Util/Translator.php +++ b/library/Icinga/Util/Translator.php @@ -255,8 +255,10 @@ class Translator usort( // Sort DESC but keep equal elements ASC $headerValues, function ($a, $b) { - $qValA = (float) (strpos($a[0], ';') > 0 ? substr(array_pop((explode(';', $a[0], 2))), 2) : 1); - $qValB = (float) (strpos($b[0], ';') > 0 ? substr(array_pop((explode(';', $b[0], 2))), 2) : 1); + $tagA = explode(';', $a[0], 2); + $tagB = explode(';', $b[0], 2); + $qValA = (float) (strpos($a[0], ';') > 0 ? substr(array_pop($tagA), 2) : 1); + $qValB = (float) (strpos($b[0], ';') > 0 ? substr(array_pop($tagB), 2) : 1); return $qValA < $qValB ? 1 : ($qValA > $qValB ? -1 : ($a[1] > $b[1] ? 1 : ($a[1] < $b[1] ? -1 : 0))); } );