Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / caxy / php-htmldiff / lib / Caxy / HtmlDiff / ListDiff.php
index a0b636301795575a2d38abd23d7f0b3a1a8881d7..da054c19af9de80f2a4b4519d22fbc6c283902d1 100644 (file)
@@ -233,7 +233,7 @@ class ListDiff extends AbstractDiff
                         $list[] = $word;
                     }
                 } else {
-                    $listType = substr($word, 1, 2);
+                    $listType = mb_substr($word, 1, 2);
                     $listStartTag = $word;
                 }
 
@@ -254,7 +254,7 @@ class ListDiff extends AbstractDiff
                 if ($openListItems === 0) {
                     // New top-level list item
                     $currentListItem = array();
-                    $listItemType = substr($word, 1, 2);
+                    $listItemType = mb_substr($word, 1, 2);
                     $listItemStart = $word;
                 } else {
                     $currentListItem[] = $word;
@@ -290,27 +290,27 @@ class ListDiff extends AbstractDiff
     {
         $filter = $type !== null ? array('<'.$type) : array('<ul', '<ol', '<dl');
 
-        return in_array(substr($word, 0, 3), $filter);
+        return in_array(mb_substr($word, 0, 3), $filter);
     }
 
     protected function isClosingListTag($word, $type = null)
     {
         $filter = $type !== null ? array('</'.$type) : array('</ul', '</ol', '</dl');
 
-        return in_array(substr($word, 0, 4), $filter);
+        return in_array(mb_substr($word, 0, 4), $filter);
     }
 
     protected function isOpeningListItemTag($word, $type = null)
     {
         $filter = $type !== null ? array('<'.$type) : array('<li', '<dd', '<dt');
 
-        return in_array(substr($word, 0, 3), $filter);
+        return in_array(mb_substr($word, 0, 3), $filter);
     }
 
     protected function isClosingListItemTag($word, $type = null)
     {
         $filter = $type !== null ? array('</'.$type) : array('</li', '</dd', '</dt');
 
-        return in_array(substr($word, 0, 4), $filter);
+        return in_array(mb_substr($word, 0, 4), $filter);
     }
 }