From 8de8c6560935a3b9b6f9b00333874b477d46bf40 Mon Sep 17 00:00:00 2001 From: JohnWE Date: Thu, 29 Nov 2018 16:56:15 -0600 Subject: [PATCH] Update HtmlDiff.php Update to make work with PHP7.2's changes to count(). I couldn't find a case where line 360 would fail, but I may be missing something. Maybe the if statement isn't necessary. --- HtmlDiff.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HtmlDiff.php b/HtmlDiff.php index 15dc7d0..ccd50ea 100644 --- a/HtmlDiff.php +++ b/HtmlDiff.php @@ -263,7 +263,7 @@ private function InsertTag( $tag, $cssClass, &$words ) { } } } - if( count( $words ) == 0 && count( $specialCaseTagInjection ) == 0 ) { + if( count( $words ) == 0 && !empty( $specialCaseTagInjection ) ) { break; } if( $specialCaseTagInjectionIsBefore ) { @@ -357,7 +357,7 @@ private function Operations() { if( $action != 'none' ) { $operations[] = new Operation( $action, $positionInOld, $match->StartInOld, $positionInNew, $match->StartInNew ); } - if( count( $match ) != 0 ) { + if( isset( $match ) ) { $operations[] = new Operation( 'equal', $match->StartInOld, $match->EndInOld(), $match->StartInNew, $match->EndInNew() ); } $positionInOld = $match->EndInOld();