From 1bb306348c011bf9f52ff2b07f61a1350b4fbd9f Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 30 Jun 2015 11:42:31 -0700 Subject: [PATCH] Fix infinite loop in renderAccessDenied() Summary: Fixes T8727. When I added `setParentQuery()`, I increased the cache hit rate but also accidentally propagated policy exception settings. Instead, make the policy exception beahvior explicit: no exceptions should be raised when querying handles. Test Plan: Will test production. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T8727 Differential Revision: https://secure.phabricator.com/D13489 --- src/applications/phid/query/PhabricatorHandleQuery.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/applications/phid/query/PhabricatorHandleQuery.php b/src/applications/phid/query/PhabricatorHandleQuery.php index 1b72edb2e2..957602838a 100644 --- a/src/applications/phid/query/PhabricatorHandleQuery.php +++ b/src/applications/phid/query/PhabricatorHandleQuery.php @@ -37,6 +37,12 @@ final class PhabricatorHandleQuery ->requireCapabilities($this->getRequiredObjectCapabilities()) ->setViewer($this->getViewer()); + // We never want the subquery to raise policy exceptions, even if this + // query is being executed via executeOne(). Policy exceptions are not + // meaningful or relevant for handles, which load in an "Unknown" or + // "Restricted" state after encountering a policy violation. + $object_query->setRaisePolicyExceptions(false); + $objects = $object_query->execute(); $filtered = $object_query->getPolicyFilteredPHIDs();