diff --git a/src/applications/project/conduit/ProjectQueryConduitAPIMethod.php b/src/applications/project/conduit/ProjectQueryConduitAPIMethod.php index d1e61640a8..f91401797a 100644 --- a/src/applications/project/conduit/ProjectQueryConduitAPIMethod.php +++ b/src/applications/project/conduit/ProjectQueryConduitAPIMethod.php @@ -97,8 +97,9 @@ 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($slug, $project['slugs'])) { + if (in_array($normal, $project['slugs'])) { $slug_map[$slug] = $project['phid']; } } diff --git a/src/applications/project/query/PhabricatorProjectQuery.php b/src/applications/project/query/PhabricatorProjectQuery.php index c0beaf2742..bb2d280ef3 100644 --- a/src/applications/project/query/PhabricatorProjectQuery.php +++ b/src/applications/project/query/PhabricatorProjectQuery.php @@ -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) {