X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fcaxy%2Fphp-htmldiff%2Flib%2FCaxy%2FHtmlDiff%2FStrategy%2FListItemMatchStrategy.php;fp=vendor%2Fcaxy%2Fphp-htmldiff%2Flib%2FCaxy%2FHtmlDiff%2FStrategy%2FListItemMatchStrategy.php;h=d41eae62667803b011dc94c06091f587e13ab6a2;hp=e086e97cf519ad0055798f4a65068fe7c89a51ab;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/caxy/php-htmldiff/lib/Caxy/HtmlDiff/Strategy/ListItemMatchStrategy.php b/vendor/caxy/php-htmldiff/lib/Caxy/HtmlDiff/Strategy/ListItemMatchStrategy.php index e086e97cf..d41eae626 100644 --- a/vendor/caxy/php-htmldiff/lib/Caxy/HtmlDiff/Strategy/ListItemMatchStrategy.php +++ b/vendor/caxy/php-htmldiff/lib/Caxy/HtmlDiff/Strategy/ListItemMatchStrategy.php @@ -63,20 +63,20 @@ class ListItemMatchStrategy implements MatchStrategyInterface // Check common prefix/ suffix length $aCleaned = trim($aStripped); $bCleaned = trim($bStripped); - if (strlen($aCleaned) === 0 || strlen($bCleaned) === 0) { + if (mb_strlen($aCleaned) === 0 || mb_strlen($bCleaned) === 0) { $aCleaned = $a; $bCleaned = $b; } - if (strlen($aCleaned) === 0 || strlen($bCleaned) === 0) { + if (mb_strlen($aCleaned) === 0 || mb_strlen($bCleaned) === 0) { return false; } $prefixIndex = Preprocessor::diffCommonPrefix($aCleaned, $bCleaned); $suffixIndex = Preprocessor::diffCommonSuffix($aCleaned, $bCleaned); // Use shorter string, and see how much of it is leftover - $len = min(strlen($aCleaned), strlen($bCleaned)); + $len = min(mb_strlen($aCleaned), mb_strlen($bCleaned)); $remaining = $len - ($prefixIndex + $suffixIndex); - $strLengthPercent = $len / max(strlen($a), strlen($b)); + $strLengthPercent = $len / max(mb_strlen($a), mb_strlen($b)); if ($remaining === 0 && $strLengthPercent > $this->lengthRatioThreshold) { return true;