mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 21:10:56 +01:00
Add slug check around project.query conduit call
Summary: Fixes T6252 Test Plan: Test project query from conduit app, see no errors in log. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T6252 Differential Revision: https://secure.phabricator.com/D10655
This commit is contained in:
parent
8aa047766d
commit
03ddb4a0fc
1 changed files with 8 additions and 6 deletions
|
@ -24,7 +24,7 @@ final class ProjectQueryConduitAPIMethod extends ProjectConduitAPIMethod {
|
|||
|
||||
return array(
|
||||
'ids' => 'optional list<int>',
|
||||
'names' => 'optional list<string>',
|
||||
'names' => 'optional list<string>',
|
||||
'phids' => 'optional list<phid>',
|
||||
'slugs' => 'optional list<string>',
|
||||
'status' => 'optional '.$status_const,
|
||||
|
@ -96,11 +96,13 @@ final class ProjectQueryConduitAPIMethod extends ProjectConduitAPIMethod {
|
|||
|
||||
// TODO: This is pretty hideous.
|
||||
$slug_map = array();
|
||||
foreach ($slugs as $slug) {
|
||||
$normal = rtrim(PhabricatorSlug::normalize($slug), '/');
|
||||
foreach ($projects as $project) {
|
||||
if (in_array($normal, $project['slugs'])) {
|
||||
$slug_map[$slug] = $project['phid'];
|
||||
if ($slugs) {
|
||||
foreach ($slugs as $slug) {
|
||||
$normal = rtrim(PhabricatorSlug::normalize($slug), '/');
|
||||
foreach ($projects as $project) {
|
||||
if (in_array($normal, $project['slugs'])) {
|
||||
$slug_map[$slug] = $project['phid'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue