revert regexp fix

This commit is contained in:
Yuri Kuznetsov
2024-01-12 14:38:31 +02:00
parent f52a3ba773
commit a17b66c6dc
+3 -1
View File
@@ -211,8 +211,10 @@ class Note extends Record
$siteUrl = $this->config->getSiteUrl();
// PhpStorm inspection highlights RegExpRedundantEscape by a mistake.
/** @noinspection RegExpRedundantEscape */
$regexp = '/' . preg_quote($siteUrl, '/') .
'(/portal|/portal/[a-zA-Z0-9]*)?/#([A-Z][a-zA-Z0-9]*)/view/([a-zA-Z0-9-]*)/';
'(\/portal|\/portal\/[a-zA-Z0-9]*)?\/#([A-Z][a-zA-Z0-9]*)\/view\/([a-zA-Z0-9-]*)/';
$post = preg_replace($regexp, '[\2/\3](#\2/view/\3)', $post);