diff --git a/src/applications/auth/adapter/PhutilBitbucketAuthAdapter.php b/src/applications/auth/adapter/PhutilBitbucketAuthAdapter.php --- a/src/applications/auth/adapter/PhutilBitbucketAuthAdapter.php +++ b/src/applications/auth/adapter/PhutilBitbucketAuthAdapter.php @@ -14,7 +14,7 @@ public function getAccountURI() { $name = $this->getAccountID(); - if (strlen($name)) { + if (phutil_nonempty_string($name)) { return 'https://bitbucket.org/'.$name; } return null; diff --git a/src/applications/auth/adapter/PhutilGitHubAuthAdapter.php b/src/applications/auth/adapter/PhutilGitHubAuthAdapter.php --- a/src/applications/auth/adapter/PhutilGitHubAuthAdapter.php +++ b/src/applications/auth/adapter/PhutilGitHubAuthAdapter.php @@ -31,7 +31,7 @@ public function getAccountURI() { $name = $this->getAccountName(); - if (strlen($name)) { + if (phutil_nonempty_string($name)) { return 'https://github.com/'.$name; } return null; diff --git a/src/applications/auth/adapter/PhutilTwitterAuthAdapter.php b/src/applications/auth/adapter/PhutilTwitterAuthAdapter.php --- a/src/applications/auth/adapter/PhutilTwitterAuthAdapter.php +++ b/src/applications/auth/adapter/PhutilTwitterAuthAdapter.php @@ -17,7 +17,7 @@ public function getAccountURI() { $name = $this->getAccountName(); - if (strlen($name)) { + if (phutil_nonempty_string($name)) { return 'https://twitter.com/'.$name; } return null; diff --git a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitQuery.php b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitQuery.php --- a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitQuery.php +++ b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitQuery.php @@ -126,11 +126,11 @@ $head = $parts[6]; $tail = $parts[7]; - if (strlen($head) && strlen($tail)) { + if (phutil_nonempty_string($head) && phutil_nonempty_string($tail)) { $body = $head."\n\n".$tail; - } else if (strlen($head)) { + } else if (phutil_nonempty_string($head)) { $body = $head; - } else if (strlen($tail)) { + } else if (phutil_nonempty_string($tail)) { $body = $tail; } else { $body = ''; diff --git a/src/infrastructure/markup/rule/PhabricatorKeyboardRemarkupRule.php b/src/infrastructure/markup/rule/PhabricatorKeyboardRemarkupRule.php --- a/src/infrastructure/markup/rule/PhabricatorKeyboardRemarkupRule.php +++ b/src/infrastructure/markup/rule/PhabricatorKeyboardRemarkupRule.php @@ -22,7 +22,7 @@ foreach ($keys as $k => $v) { $v = trim($v, " \n"); $v = preg_replace('/\\\\(.)/', '\\1', $v); - if (!strlen($v)) { + if (!phutil_nonempty_string($v)) { unset($keys[$k]); continue; }