mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-03 03:11:01 +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(
|
return array(
|
||||||
'ids' => 'optional list<int>',
|
'ids' => 'optional list<int>',
|
||||||
'names' => 'optional list<string>',
|
'names' => 'optional list<string>',
|
||||||
'phids' => 'optional list<phid>',
|
'phids' => 'optional list<phid>',
|
||||||
'slugs' => 'optional list<string>',
|
'slugs' => 'optional list<string>',
|
||||||
'status' => 'optional '.$status_const,
|
'status' => 'optional '.$status_const,
|
||||||
|
@ -96,11 +96,13 @@ final class ProjectQueryConduitAPIMethod extends ProjectConduitAPIMethod {
|
||||||
|
|
||||||
// TODO: This is pretty hideous.
|
// TODO: This is pretty hideous.
|
||||||
$slug_map = array();
|
$slug_map = array();
|
||||||
foreach ($slugs as $slug) {
|
if ($slugs) {
|
||||||
$normal = rtrim(PhabricatorSlug::normalize($slug), '/');
|
foreach ($slugs as $slug) {
|
||||||
foreach ($projects as $project) {
|
$normal = rtrim(PhabricatorSlug::normalize($slug), '/');
|
||||||
if (in_array($normal, $project['slugs'])) {
|
foreach ($projects as $project) {
|
||||||
$slug_map[$slug] = $project['phid'];
|
if (in_array($normal, $project['slugs'])) {
|
||||||
|
$slug_map[$slug] = $project['phid'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue