From 78f2f40b0d46c290dcd3e7fc574b29b07e19b6a3 Mon Sep 17 00:00:00 2001 From: phreeek Date: Thu, 4 Oct 2018 20:35:56 +0200 Subject: [PATCH] Fixes count() NULL bug for SequenceMatcher.php PHP 7.2 is stricter about invoking count() with parameters which are not countable: https://secure.php.net/manual/en/migration72.incompatible.php This case is triggered in SequenceMatcher, for example when reviewing a initial history entry of a host template: count(): Parameter must be an array or an object that implements Countable (SequenceMatcher.php:352) I fixed this like in Icinga/icingaweb2-module-director#1458. Signed-off-by: phreeek --- library/vendor/php-diff/lib/Diff/SequenceMatcher.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/vendor/php-diff/lib/Diff/SequenceMatcher.php b/library/vendor/php-diff/lib/Diff/SequenceMatcher.php index a289e391a..adfefffb4 100644 --- a/library/vendor/php-diff/lib/Diff/SequenceMatcher.php +++ b/library/vendor/php-diff/lib/Diff/SequenceMatcher.php @@ -349,8 +349,8 @@ public function getMatchingBlocks() return $this->matchingBlocks; } - $aLength = count($this->a); - $bLength = count($this->b); + $aLength = (isset($this->a) ? count($this->a) : 0); + $bLength = (isset($this->b) ? count($this->b) : 0); $queue = array( array(