diff --git a/src/AliasCleaner.php b/src/AliasCleaner.php index 340a266..5d83dd5 100644 --- a/src/AliasCleaner.php +++ b/src/AliasCleaner.php @@ -335,7 +335,7 @@ class AliasCleaner implements AliasCleanerInterface { public function cleanTokenValues(&$replacements, $data = array(), $options = array()) { foreach ($replacements as $token => $value) { // Only clean non-path tokens. - if (!preg_match('/(path|alias|url|url-brief)\]$/', $token)) { + if (!preg_match('/:(alias|path|login-url|url|url-brief)(:|\]$)/', $token)) { $replacements[$token] = $this->cleanString($value, $options); } } diff --git a/tests/src/Kernel/PathautoTokenTest.php b/tests/src/Kernel/PathautoTokenTest.php index 30c5ad1..7d02002 100644 --- a/tests/src/Kernel/PathautoTokenTest.php +++ b/tests/src/Kernel/PathautoTokenTest.php @@ -29,7 +29,7 @@ class PathautoTokenTest extends KernelTestBase { ); $tokens = array( - 'join-path' => 'test-first-arg/array-value', + 'path' => 'test-first-arg/array-value', ); $data['array'] = $array; $replacements = $this->assertTokens('array', $data, $tokens); @@ -38,7 +38,7 @@ class PathautoTokenTest extends KernelTestBase { /* @var \Drupal\pathauto\AliasCleanerInterface $alias_cleaner */ $alias_cleaner = \Drupal::service('pathauto.alias_cleaner'); $alias_cleaner->cleanTokenValues($replacements, $data, array()); - $this->assertEqual($replacements['[array:join-path]'], 'test-first-arg/array-value'); + $this->assertEqual($replacements['[array:path]'], 'test-first-arg/array-value'); } /**