diff --git a/core/lib/Drupal/Core/Path/AliasManager.php b/core/lib/Drupal/Core/Path/AliasManager.php index 9ebaa8c..82c19bd 100644 --- a/core/lib/Drupal/Core/Path/AliasManager.php +++ b/core/lib/Drupal/Core/Path/AliasManager.php @@ -132,7 +132,7 @@ public function getAliasByPath($path, $language = NULL) { // Check the path whitelist, if the top-level part before the first / // is not in the list, then there is no need to do anything further, // it is not in the database. - if (!$this->whitelist->get(strtok($path, '/'))) { + if (empty($path) || !$this->whitelist->get(strtok($path, '/'))) { return $path; } @@ -150,7 +150,7 @@ public function getAliasByPath($path, $language = NULL) { } // If we already know that there are no aliases for this path simply return. - if (empty($path) || !empty($this->noAlias[$language][$path])) { + if (!empty($this->noAlias[$language][$path])) { return $path; } diff --git a/core/modules/path/lib/Drupal/path/Form/PathFormBase.php b/core/modules/path/lib/Drupal/path/Form/PathFormBase.php index 251fbe3..ca507d1 100644 --- a/core/modules/path/lib/Drupal/path/Form/PathFormBase.php +++ b/core/modules/path/lib/Drupal/path/Form/PathFormBase.php @@ -137,7 +137,7 @@ public function buildForm(array $form, array &$form_state, $pid = NULL) { */ public function validateForm(array &$form, array &$form_state) { $source = &$form_state['values']['source']; - $source = $this->aliasManager->getSystemPath($source); + $source = $this->aliasManager->getPathByAlias($source); $alias = $form_state['values']['alias']; // Language is only set if language.module is enabled, otherwise save for all // languages. @@ -160,7 +160,7 @@ public function submitForm(array &$form, array &$form_state) { $pid = isset($form_state['values']['pid']) ? $form_state['values']['pid'] : 0; $source = &$form_state['values']['source']; - $source = $this->aliasManager->getSystemPath($source); + $source = $this->aliasManager->getPathByAlias($source); $alias = $form_state['values']['alias']; // Language is only set if language.module is enabled, otherwise save for all // languages.