From 28341307922c193ce571215e1e40aaf15074e756 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 10 Jun 2014 12:17:23 -0700 Subject: [PATCH] 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 --- .../people/phid/PhabricatorPeoplePHIDTypeUser.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/applications/people/phid/PhabricatorPeoplePHIDTypeUser.php b/src/applications/people/phid/PhabricatorPeoplePHIDTypeUser.php index a4c344c326..5f13d0e9a6 100644 --- a/src/applications/people/phid/PhabricatorPeoplePHIDTypeUser.php +++ b/src/applications/people/phid/PhabricatorPeoplePHIDTypeUser.php @@ -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; } }