Normalize project slugs before querying for them
Summary: Fixes T5728. In particular: - `/tag/XYZ/` now works as an alias for `/tag/xyz/`. - `arc todo --project ASDF` now works as an alias for `arc todo --project asdf`. Test Plan: Called `project.query` and visited `/tag/LBHABLHBH/`. Reviewers: btrahan Reviewed By: btrahan Subscribers: aklapper, epriestley Maniphest Tasks: T5728 Differential Revision: https://secure.phabricator.com/D10144
This commit is contained in:
@@ -266,10 +266,15 @@ final class PhabricatorProjectQuery
|
||||
}
|
||||
|
||||
if ($this->slugs) {
|
||||
$slugs = array();
|
||||
foreach ($this->slugs as $slug) {
|
||||
$slugs[] = rtrim(PhabricatorSlug::normalize($slug), '/');
|
||||
}
|
||||
|
||||
$where[] = qsprintf(
|
||||
$conn_r,
|
||||
'slug.slug IN (%Ls)',
|
||||
$this->slugs);
|
||||
$slugs);
|
||||
}
|
||||
|
||||
if ($this->phrictionSlugs) {
|
||||
|
||||
Reference in New Issue
Block a user