@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+8 -2
+2 -1
src/applications/project/conduit/ProjectQueryConduitAPIMethod.php
··· 97 97 // TODO: This is pretty hideous. 98 98 $slug_map = array(); 99 99 foreach ($slugs as $slug) { 100 + $normal = rtrim(PhabricatorSlug::normalize($slug), '/'); 100 101 foreach ($projects as $project) { 101 - if (in_array($slug, $project['slugs'])) { 102 + if (in_array($normal, $project['slugs'])) { 102 103 $slug_map[$slug] = $project['phid']; 103 104 } 104 105 }
+6 -1
src/applications/project/query/PhabricatorProjectQuery.php
··· 266 266 } 267 267 268 268 if ($this->slugs) { 269 + $slugs = array(); 270 + foreach ($this->slugs as $slug) { 271 + $slugs[] = rtrim(PhabricatorSlug::normalize($slug), '/'); 272 + } 273 + 269 274 $where[] = qsprintf( 270 275 $conn_r, 271 276 'slug.slug IN (%Ls)', 272 - $this->slugs); 277 + $slugs); 273 278 } 274 279 275 280 if ($this->phrictionSlugs) {