diff --git a/core/lib/Drupal/Core/Utility/Token.php b/core/lib/Drupal/Core/Utility/Token.php index 8c993c8..5487fd2 100644 --- a/core/lib/Drupal/Core/Utility/Token.php +++ b/core/lib/Drupal/Core/Utility/Token.php @@ -184,9 +184,7 @@ public function __construct(ModuleHandlerInterface $module_handler, CacheBackend */ public function replace($text, array $data = array(), array $options = array(), BubbleableMetadata $bubbleable_metadata = NULL) { $text_tokens = $this->scan($text); - ksm('$text_tokens ', $text_tokens ); $text_token_aliases = $this->alias_scan($text); - ksm('$text_token_aliases', $text_token_aliases); if (empty($text_tokens) && empty($text_token_aliases)) { return $text; @@ -282,7 +280,7 @@ public function scan($text) { // $type may not contain : or whitespace characters, but $name may. preg_match_all('/ \[ # [ - pattern start - ([^\s\[\]:]+) # match $type not containing whitespace : [ or ] + ([^\s\[\]:{}]+) # match $type not containing whitespace : [ or ] : # : - separator ([^\[\]]+) # match $name not containing [ or ] \] # ] - pattern end @@ -320,7 +318,7 @@ public function alias_scan($text) { ([^\s\[\]:]*) # match $type not containing whitespace : [ or ] {([^\[\]]*)} # match $alias name : # : - separator - ([^\[\]]*) # match $name not containing [ or ] + ([^\[\]]+) # match $name not containing [ or ] \] # ] - pattern end /x', $text, $matches); @@ -330,7 +328,7 @@ public function alias_scan($text) { // Iterate through the matches, building an associative array containing - // $alias grouped by $types, and those $alias contains paris of $tokens keys + // $alias grouped by $types, and those $alias contains pairs of $tokens keys // and the complete token found in the source text. For example, // $results['node'['alias1']['title'] = '[node{alias1}:title]'; $results = array();