diff --git a/src/applications/config/check/PhabricatorWebServerSetupCheck.php b/src/applications/config/check/PhabricatorWebServerSetupCheck.php
--- a/src/applications/config/check/PhabricatorWebServerSetupCheck.php
+++ b/src/applications/config/check/PhabricatorWebServerSetupCheck.php
@@ -23,7 +23,7 @@
     }
 
     $base_uri = PhabricatorEnv::getEnvConfig('phabricator.base-uri');
-    if (!strlen($base_uri)) {
+    if (!phutil_nonempty_string($base_uri)) {
       // If `phabricator.base-uri` is not set then we can't really do
       // anything.
       return;
diff --git a/src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php b/src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php
--- a/src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php
+++ b/src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php
@@ -208,12 +208,12 @@
     $this->activeEngine = $engine;
 
     $encode_setting = $request->getStr('encode');
-    if (strlen($encode_setting)) {
+    if (phutil_nonempty_string($encode_setting)) {
       $engine->setEncodingConfiguration($encode_setting);
     }
 
     $highlight_setting = $request->getStr('highlight');
-    if (strlen($highlight_setting)) {
+    if (phutil_nonempty_string($highlight_setting)) {
       $engine->setHighlightingConfiguration($highlight_setting);
     }
 
diff --git a/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
--- a/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
+++ b/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
@@ -75,6 +75,9 @@
     $viewer = $this->getViewer();
 
     $type = $args->getArg('type');
+    if (!phutil_nonempty_string($type)) {
+      $type = PhabricatorMailEmailMessage::MESSAGETYPE;
+    }
     $type_map = PhabricatorMailExternalMessage::getAllMessageTypes();
     if (!isset($type_map[$type])) {
       throw new PhutilArgumentUsageException(
diff --git a/src/applications/people/mail/PhabricatorPeopleEmailLoginMailEngine.php b/src/applications/people/mail/PhabricatorPeopleEmailLoginMailEngine.php
--- a/src/applications/people/mail/PhabricatorPeopleEmailLoginMailEngine.php
+++ b/src/applications/people/mail/PhabricatorPeopleEmailLoginMailEngine.php
@@ -64,7 +64,7 @@
     $message_body = PhabricatorAuthMessage::loadMessageText(
       $recipient,
       $message_key);
-    if (strlen($message_body)) {
+    if (phutil_nonempty_string($message_body)) {
       $body[] = $this->newRemarkupText($message_body);
     }
 
diff --git a/src/applications/search/controller/PhabricatorSearchController.php b/src/applications/search/controller/PhabricatorSearchController.php
--- a/src/applications/search/controller/PhabricatorSearchController.php
+++ b/src/applications/search/controller/PhabricatorSearchController.php
@@ -13,7 +13,7 @@
     $viewer = $this->getViewer();
     $query = $request->getStr('query');
 
-    if ($request->getStr('jump') != 'no' && strlen($query)) {
+    if ($request->getStr('jump') != 'no' && phutil_nonempty_string($query)) {
       $jump_uri = id(new PhabricatorDatasourceEngine())
         ->setViewer($viewer)
         ->newJumpURI($query);