Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Core / Entity / Plugin / EntityReferenceSelection / PhpSelection.php
index 4545ebbe866a2c51d7e2aefcb59dbf38c31edc07..52cf33d29d7dac7dbb2e449e2d5193214e7b8497 100644 (file)
@@ -3,7 +3,6 @@
 namespace Drupal\Core\Entity\Plugin\EntityReferenceSelection;
 
 use Drupal\Component\Utility\Html;
-use Drupal\Component\Utility\Unicode;
 
 /**
  * Defines an alternative to the default Entity Reference Selection plugin.
@@ -35,11 +34,11 @@ class PhpSelection extends DefaultSelection {
     // possible.
     // @see \Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface::getReferenceableEntities()
     if (is_string($match)) {
-      $match = Html::escape(Unicode::strtolower($match));
+      $match = Html::escape(mb_strtolower($match));
     }
     elseif (is_array($match)) {
       array_walk($match, function (&$item) {
-        $item = Html::escape(Unicode::strtolower($item));
+        $item = Html::escape(mb_strtolower($item));
       });
     }
 
@@ -89,7 +88,7 @@ class PhpSelection extends DefaultSelection {
    */
   protected function matchLabel($match, $match_operator, $label) {
     // Always use a case-insensitive value.
-    $label = Unicode::strtolower($label);
+    $label = mb_strtolower($label);
 
     switch ($match_operator) {
       case '=':
@@ -113,7 +112,7 @@ class PhpSelection extends DefaultSelection {
       case 'CONTAINS':
         return strpos($label, $match) !== FALSE;
       case 'ENDS_WITH':
-        return Unicode::substr($label, -Unicode::strlen($match)) === (string) $match;
+        return mb_substr($label, -mb_strlen($match)) === (string) $match;
       case 'IS NOT NULL':
         return TRUE;
       case 'IS NULL':