diff --git a/src/applications/owners/typeahead/PhabricatorOwnersPackageDatasource.php b/src/applications/owners/typeahead/PhabricatorOwnersPackageDatasource.php index ea60acb54c..e93b3df7e9 100644 --- a/src/applications/owners/typeahead/PhabricatorOwnersPackageDatasource.php +++ b/src/applications/owners/typeahead/PhabricatorOwnersPackageDatasource.php @@ -26,7 +26,7 @@ final class PhabricatorOwnersPackageDatasource // If the user is querying by monogram explicitly, like "O123", do an ID // search. Otherwise, do an ngram substring search. - if (preg_match('/^[oO]\d+\z/', $raw_query)) { + if ($raw_query && preg_match('/^[oO]\d+\z/', $raw_query)) { $id = trim($raw_query, 'oO'); $id = (int)$id; $query->withIDs(array($id)); diff --git a/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php b/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php index 42ccad3316..6ad91b52ea 100644 --- a/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php +++ b/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php @@ -2449,7 +2449,7 @@ abstract class PhabricatorCursorPagedPolicyAwareQuery PhabricatorSearchNgrams $index, $value) { - if (strlen($value)) { + if (phutil_nonempty_string($value)) { $this->ngrams[] = array( 'index' => $index, 'value' => $value,