Browse Source

New regex to match mentions

Signed-off-by: Mario Danic <mario@lovelyhq.com>
Mario Danic 6 years ago
parent
commit
47769d2640
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/private/Comments/Comment.php

+ 1 - 1
lib/private/Comments/Comment.php

@@ -225,7 +225,7 @@ class Comment implements IComment {
 	 *
 	 */
 	public function getMentions() {
-		$ok = preg_match_all('/\B(^@\w+|(?<=\s)@\w+)/i', $this->getMessage(), $mentions);
+		$ok = preg_match_all("/\B(?<![^a-z0-9_\-@\.\'\s])@[a-z0-9_\-@\.\']+/i", $this->getMessage(), $mentions);
 		if(!$ok || !isset($mentions[0]) || !is_array($mentions[0])) {
 			return [];
 		}