diff options
author | Joas Schilling <coding@schilljs.com> | 2018-10-12 14:26:22 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2018-11-07 12:33:44 +0100 |
commit | 375589b274ad6da55f1a516c953b807105dfd2a4 (patch) | |
tree | 993a8f3924d0455f0b803ff9cc0338e9b19793ce /apps/comments/lib | |
parent | 10ba0bed8a6a3f43526c36768feea522325d4a80 (diff) | |
download | nextcloud-server-375589b274ad6da55f1a516c953b807105dfd2a4.tar.gz nextcloud-server-375589b274ad6da55f1a516c953b807105dfd2a4.zip |
Fix the comments UI and activities for space-mentions
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/comments/lib')
-rw-r--r-- | apps/comments/lib/Activity/Provider.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/comments/lib/Activity/Provider.php b/apps/comments/lib/Activity/Provider.php index c21b7a9c4fd..4940bb6afec 100644 --- a/apps/comments/lib/Activity/Provider.php +++ b/apps/comments/lib/Activity/Provider.php @@ -213,8 +213,13 @@ class Provider implements IProvider { continue; } + $pattern = '/(^|\s)(' . '@' . $mention['id'] . ')(\b)/'; + if (strpos($mention['id'], ' ') !== false) { + $pattern = '/(^|\s)(' . '@"' . $mention['id'] . '"' . ')(\b)?/'; + } + $message = preg_replace( - '/(^|\s)(' . '@' . $mention['id'] . ')(\b)/', + $pattern, //'${1}' . $this->regexSafeUser($mention['id'], $displayName) . '${3}', '${1}' . '{mention' . $mentionCount . '}' . '${3}', $message |