diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2018-06-08 18:02:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-08 18:02:46 +0200 |
commit | fd1498a1712401a1c5f6228c0fabb5017d88c3ee (patch) | |
tree | 75d11e1c2c05aa449403e26b3fce8a10fb66b3fb /lib | |
parent | 8d26f9cd6d2304cd650e900a280f09a5f43396ef (diff) | |
parent | d959ca8eb07b284a18bcfe6eee58a42b90e7e785 (diff) | |
download | nextcloud-server-fd1498a1712401a1c5f6228c0fabb5017d88c3ee.tar.gz nextcloud-server-fd1498a1712401a1c5f6228c0fabb5017d88c3ee.zip |
Merge pull request #9793 from nextcloud/fix-mention-regex
Fix mentions regex
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Comments/Comment.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/Comments/Comment.php b/lib/private/Comments/Comment.php index dd790c2e50a..94c43be622b 100644 --- a/lib/private/Comments/Comment.php +++ b/lib/private/Comments/Comment.php @@ -225,7 +225,7 @@ class Comment implements IComment { * */ public function getMentions() { - $ok = preg_match_all('/\B@[a-z0-9_\-@\.\']+/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 []; } |