mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-18 18:51:12 +01:00
Make named lookup of users case insensitive
Summary: Fixes T5302. Allow the name `@aLiNCoLN` to identify user `@alincoln`. Test Plan: Queried users with mixed case names. Reviewers: btrahan, spicyj, chad Reviewed By: spicyj Subscribers: epriestley Maniphest Tasks: T5302 Differential Revision: https://secure.phabricator.com/D9451
This commit is contained in:
parent
0bdf18fdd2
commit
2834130792
1 changed files with 4 additions and 2 deletions
|
@ -68,6 +68,7 @@ final class PhabricatorPeoplePHIDTypeUser extends PhabricatorPHIDType {
|
|||
$id_map = array();
|
||||
foreach ($names as $name) {
|
||||
$id = substr($name, 1);
|
||||
$id = phutil_utf8_strtolower($id);
|
||||
$id_map[$id][] = $name;
|
||||
}
|
||||
|
||||
|
@ -78,8 +79,9 @@ final class PhabricatorPeoplePHIDTypeUser extends PhabricatorPHIDType {
|
|||
|
||||
$results = array();
|
||||
foreach ($objects as $id => $object) {
|
||||
$username = $object->getUsername();
|
||||
foreach (idx($id_map, $username, array()) as $name) {
|
||||
$user_key = $object->getUsername();
|
||||
$user_key = phutil_utf8_strtolower($user_key);
|
||||
foreach (idx($id_map, $user_key, array()) as $name) {
|
||||
$results[$name] = $object;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue