From a8924e971e9f053e652e0f0f0b462162a3dd89b3 Mon Sep 17 00:00:00 2001 From: michaelpollak Date: Thu, 24 Jun 2021 13:12:21 +0200 Subject: [PATCH] Tags followed by @ are not masked see #163 --- view/view_class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/view/view_class.php b/view/view_class.php index f54964a3..ba067c3f 100644 --- a/view/view_class.php +++ b/view/view_class.php @@ -715,7 +715,8 @@ public function mask_tags($text) { $matches = array(); $find = array(); $replace = array(); - preg_match_all('/(?:(\[\[[^\]]+\]\])|(##[^#]+##)|(%%[^%]+%%)|(#\{\{[^\}#]+\}\}#))/', $text, + // Regex to mask all known tag patterns. Patterns followed by @ are not masked. + preg_match_all('/(?:(\[\[[^\]]+\]\])(?!@)|(##[^#]+##)|(%%[^%]+%%)|(#\{\{[^\}#]+\}\}#))/', $text, $matches, PREG_PATTERN_ORDER); $map = array_unique($matches[0]); foreach ($map as $index => $match) {