From 1780bd6754e5aca7522c8742744f4e60d9ec4c12 Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 14 Feb 2024 02:42:42 +0200 Subject: [PATCH] fix ns expression --- src/Twig/AppExtension.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Twig/AppExtension.php b/src/Twig/AppExtension.php index 1bdc799..c5e923b 100644 --- a/src/Twig/AppExtension.php +++ b/src/Twig/AppExtension.php @@ -215,14 +215,14 @@ class AppExtension extends AbstractExtension ): string { // Search not filtered namespaces - if (preg_match_all('/(^(?!\/)N[A-z0-9]{33})/', $text, $matches)) + if (preg_match_all('/(^|\s)(N[A-z0-9]{33})/', $text, $matches)) { - if (empty($matches[1])) + if (empty($matches[2])) { return $text; } - foreach ($matches[1] as $namespace) + foreach ($matches[2] as $namespace) { // Replace with _CLITOR_IS_ value if ($meta = $this->_clitor($namespace))