diff --git a/core/lib/Drupal/Core/Path/PathMatcher.php b/core/lib/Drupal/Core/Path/PathMatcher.php index 6aa4b57..98a45ec 100644 --- a/core/lib/Drupal/Core/Path/PathMatcher.php +++ b/core/lib/Drupal/Core/Path/PathMatcher.php @@ -42,7 +42,7 @@ public function __construct(ConfigFactory $config_factory) { * {@inheritdoc} */ public function matchPath($path, array $patterns) { - // Convert array of patterns to a string with regex 'or'. + // Convert array to a string for easier find and replace. $pattern_string = implode("\n", $patterns); if (!isset($this->regexes[$pattern_string])) { // Convert path settings to a regular expression. diff --git a/core/modules/system/lib/Drupal/system/Plugin/Core/Condition/RequestPath.php b/core/modules/system/lib/Drupal/system/Plugin/Core/Condition/RequestPath.php index c1e5ef9..ca30449 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/Core/Condition/RequestPath.php +++ b/core/modules/system/lib/Drupal/system/Plugin/Core/Condition/RequestPath.php @@ -123,10 +123,7 @@ public function submit($form, &$form_state) { * {@inheritdoc} */ public function summary() { - $pages = array(); - foreach (explode("\n", $this->configuration['pages']) as $page) { - $pages[] = trim($page); - } + $pages = array_map('trim', explode("\n", $this->configuration['pages'])); $pages = implode(', ', $pages); if (!empty($this->configuration['negate'])) { return $this->t('Do not return true on the following pages: @pages', array('@pages' => $pages));