summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2021-03-05 09:55:44 +0100
committerGitHub <noreply@github.com>2021-03-05 09:55:44 +0100
commit3aba094d86ae6008a6ff6d6a5ec7eff9f0b5dc69 (patch)
treede7952886e9aff725c269150a14c1a2c3fa166b0 /lib/private
parentb4b55616c2f78f16b70be24f5613cd89e2971486 (diff)
parent5164f43bd36645fc274d6ab18ead37a906631fd4 (diff)
downloadnextcloud-server-3aba094d86ae6008a6ff6d6a5ec7eff9f0b5dc69.tar.gz
nextcloud-server-3aba094d86ae6008a6ff6d6a5ec7eff9f0b5dc69.zip
Merge pull request #25573 from nextcloud/backport/25378/stable21
[stable21] Improve mention matches
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Comments/Comment.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/Comments/Comment.php b/lib/private/Comments/Comment.php
index 7368425174a..8517bef5893 100644
--- a/lib/private/Comments/Comment.php
+++ b/lib/private/Comments/Comment.php
@@ -233,6 +233,9 @@ class Comment implements IComment {
return [];
}
$uids = array_unique($mentions[0]);
+ usort($uids, static function ($uid1, $uid2) {
+ return mb_strlen($uid2) <=> mb_strlen($uid1);
+ });
$result = [];
foreach ($uids as $uid) {
$cleanUid = trim(substr($uid, 1), '"');