diff --git a/core/lib/Drupal/Core/Path/AliasStorage.php b/core/lib/Drupal/Core/Path/AliasStorage.php index b9f65fe..0ef4a12 100644 --- a/core/lib/Drupal/Core/Path/AliasStorage.php +++ b/core/lib/Drupal/Core/Path/AliasStorage.php @@ -99,10 +99,8 @@ public function save($source, $alias, $langcode = LanguageInterface::LANGCODE_NO public function load($conditions) { $select = $this->connection->select('url_alias'); foreach ($conditions as $field => $value) { - if ($field == 'alias') { - $value = Unicode::strtolower($value); - } - $select->condition($field, $value); + // Use LIKE for case-insensitive matching. + $select->condition($field, $value, 'LIKE'); } return $select ->fields('url_alias') @@ -119,10 +117,8 @@ public function delete($conditions) { $path = $this->load($conditions); $query = $this->connection->delete('url_alias'); foreach ($conditions as $field => $value) { - if ($field == 'alias') { - $value = Unicode::strtolower($value); - } - $query->condition($field, $value); + // Use LIKE for case-insensitive matching. + $query->condition($field, $value, 'LIKE'); } $deleted = $query->execute(); // @todo Switch to using an event for this instead of a hook. @@ -215,7 +211,8 @@ public function lookupPathSource($path, $langcode) { */ public function aliasExists($alias, $langcode, $source = NULL) { $query = $this->connection->select('url_alias') - ->condition('alias', Unicode::strtolower($alias)) + // Use LIKE for case-insensitive matching. + ->condition('alias', $alias, 'LIKE') ->condition('langcode', $langcode); if (!empty($source)) { $query->condition('source', $source, '<>'); @@ -241,7 +238,7 @@ public function getAliasesForAdminListing($header, $keys = NULL) { ->extend('Drupal\Core\Database\Query\TableSortExtender'); if ($keys) { // Replace wildcards with PDO wildcards. - $query->condition('alias', '%' . preg_replace('!\*+!', '%', Unicode::strtolower($keys)) . '%', 'LIKE'); + $query->condition('alias', '%' . preg_replace('!\*+!', '%', $keys) . '%', 'LIKE'); } return $query ->fields('url_alias') diff --git a/core/lib/Drupal/Core/Path/AliasStorageInterface.php b/core/lib/Drupal/Core/Path/AliasStorageInterface.php index 63cb942..3f55413 100644 --- a/core/lib/Drupal/Core/Path/AliasStorageInterface.php +++ b/core/lib/Drupal/Core/Path/AliasStorageInterface.php @@ -97,8 +97,7 @@ public function lookupPathAlias($path, $langcode); * Returns Drupal system URL of an alias. * * @param string $path - * The path to investigate for corresponding system URLs. This will be - * converted to lowercase. + * The path to investigate for corresponding system URLs. * @param string $langcode * Language code to search the path with. If there's no path defined for * that language it will search paths without language. @@ -112,7 +111,7 @@ public function lookupPathSource($path, $langcode); * Checks if alias already exists. * * @param string $alias - * Alias to check against. This will be converted to lowercase. + * Alias to check against. * @param string $langcode * Language of the alias. * @param string|null $source @@ -138,7 +137,7 @@ public function languageAliasExists(); * Table header. * @param string|null $keys * (optional) Search keyword that may include one or more '*' as a wildcard - * value. This will be converted to lowercase. + * value. * * @return array * Array of items to be displayed on the current page.