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.
// 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));
});
}
*/
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 '=':
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':