Index: src/applications/search/controller/PhabricatorApplicationSearchController.php =================================================================== --- src/applications/search/controller/PhabricatorApplicationSearchController.php +++ src/applications/search/controller/PhabricatorApplicationSearchController.php @@ -198,7 +198,16 @@ $pager = new AphrontCursorPagerView(); $pager->readFromRequest($request); - $pager->setPageSize($engine->getPageSize($saved_query)); + $page_size = $engine->getPageSize($saved_query); + if (is_finite($page_size)) { + $pager->setPageSize($page_size); + } else { + // Consider an INF pagesize to mean a large finite pagesize. + + // TODO: It would be nice to handle this more gracefully, but math + // with INF seems to vary across PHP versions, systems, and runtimes. + $pager->setPageSize(0xFFFF); + } $objects = $query->setViewer($request->getUser()) ->executeWithCursorPager($pager); Index: src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php =================================================================== --- src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php +++ src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php @@ -19,6 +19,11 @@ } protected function getPagingValue($result) { + if (!is_object($result)) { + // This interface can't be typehinted and PHP gets really angry if we + // call a method on a non-object, so add an explicit check here. + throw new Exception(pht('Expected object, got "%s"!', gettype($result))); + } return $result->getID(); }