1
0
Fork 0
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:
Chad Little 2014-10-07 15:05:57 -07:00
parent 8aa047766d
commit 03ddb4a0fc

View file

@ -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'];
}
}
}
}