From: Alexander Ebert Date: Sat, 15 Aug 2020 17:35:58 +0000 (+0200) Subject: Prefer longer group names for mentions X-Git-Tag: 5.2.9~23 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f9f78858c21b0352ad0a7853f281c5cba21d835d;p=GitHub%2FWoltLab%2FWCF.git Prefer longer group names for mentions --- diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php index 601b089cf1..a789066f88 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php @@ -323,9 +323,9 @@ class HtmlInputNodeTextParser { return []; } - // Sorting the usernames by length allows for more precise matches. - usort($usernames, function ($usernameA, $usernameB) { - return mb_strlen($usernameA) - mb_strlen($usernameB); + // Sorting the group names by length allows for more precise matches. + usort($availableUserGroups, function (UserGroup $groupA, UserGroup $groupB) { + return mb_strlen($groupA->getName()) - mb_strlen($groupB->getName()); }); $groups = [];