From ea698b670267b230ecd958424720fe29d4b836bc Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 23 Sep 2020 15:57:10 +0000 Subject: [PATCH] Delimiter added --- src/Protocol/ActivityPub/Processor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 7026d18da..95eecabca 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -856,7 +856,7 @@ class Processor } // We check with "strpos" for performance issues. Only when this is true, the regular expression check is used // RegExp is taken from here: https://medium.com/@shiba1014/regex-word-boundaries-with-unicode-207794f6e7ed - if ((strpos($content, $tag) !== false) && preg_match('/(?<=[\s,.:;"\']|^)' . preg_quote($tag) . '(?=[\s,.:;"\']|$)/', $content)) { + if ((strpos($content, $tag) !== false) && preg_match('/(?<=[\s,.:;"\']|^)' . preg_quote($tag, '/') . '(?=[\s,.:;"\']|$)/', $content)) { Logger::info('Subscribed hashtag found in content - accepted', ['id' => $id, 'hashtag' => $tag]); return true; }