diff --git a/src/applications/diviner/query/DivinerBookQuery.php b/src/applications/diviner/query/DivinerBookQuery.php --- a/src/applications/diviner/query/DivinerBookQuery.php +++ b/src/applications/diviner/query/DivinerBookQuery.php @@ -133,7 +133,7 @@ $this->phids); } - if (strlen($this->nameLike)) { + if (phutil_nonempty_string($this->nameLike)) { $where[] = qsprintf( $conn, 'name LIKE %~', @@ -147,7 +147,7 @@ $this->names); } - if (strlen($this->namePrefix)) { + if (phutil_nonempty_string($this->namePrefix)) { $where[] = qsprintf( $conn, 'name LIKE %>', diff --git a/src/applications/diviner/storage/DivinerLiveSymbol.php b/src/applications/diviner/storage/DivinerLiveSymbol.php --- a/src/applications/diviner/storage/DivinerLiveSymbol.php +++ b/src/applications/diviner/storage/DivinerLiveSymbol.php @@ -182,7 +182,7 @@ public function setTitle($value) { $this->writeField('title', $value); - if (strlen($value)) { + if (phutil_nonempty_string($value)) { $slug = DivinerAtomRef::normalizeTitleString($value); $hash = PhabricatorHash::digestForIndex($slug); $this->titleSlugHash = $hash; diff --git a/src/applications/diviner/workflow/DivinerGenerateWorkflow.php b/src/applications/diviner/workflow/DivinerGenerateWorkflow.php --- a/src/applications/diviner/workflow/DivinerGenerateWorkflow.php +++ b/src/applications/diviner/workflow/DivinerGenerateWorkflow.php @@ -194,7 +194,7 @@ $identifier = $args->getArg('repository'); $repository = null; - if (strlen($identifier)) { + if (phutil_nonempty_string($identifier)) { $repository = id(new PhabricatorRepositoryQuery()) ->setViewer(PhabricatorUser::getOmnipotentUser()) ->withIdentifiers(array($identifier))