diff --git a/src/applications/auth/adapter/PhutilBitbucketAuthAdapter.php b/src/applications/auth/adapter/PhutilBitbucketAuthAdapter.php index 1384548d5e..baf9d5407e 100644 --- a/src/applications/auth/adapter/PhutilBitbucketAuthAdapter.php +++ b/src/applications/auth/adapter/PhutilBitbucketAuthAdapter.php @@ -14,7 +14,7 @@ final class PhutilBitbucketAuthAdapter extends PhutilOAuth1AuthAdapter { 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 index a9d4c849d5..5d85a2ac21 100644 --- a/src/applications/auth/adapter/PhutilGitHubAuthAdapter.php +++ b/src/applications/auth/adapter/PhutilGitHubAuthAdapter.php @@ -31,7 +31,7 @@ final class PhutilGitHubAuthAdapter extends PhutilOAuthAuthAdapter { 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 index 6f738c75f6..02a1f59a67 100644 --- a/src/applications/auth/adapter/PhutilTwitterAuthAdapter.php +++ b/src/applications/auth/adapter/PhutilTwitterAuthAdapter.php @@ -17,7 +17,7 @@ final class PhutilTwitterAuthAdapter extends PhutilOAuth1AuthAdapter { 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 index 8b9233f128..0b5df04a41 100644 --- a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitQuery.php +++ b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitQuery.php @@ -126,11 +126,11 @@ final class DiffusionLowLevelCommitQuery $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 index c5344a692c..a28735cfe9 100644 --- a/src/infrastructure/markup/rule/PhabricatorKeyboardRemarkupRule.php +++ b/src/infrastructure/markup/rule/PhabricatorKeyboardRemarkupRule.php @@ -22,7 +22,7 @@ final class PhabricatorKeyboardRemarkupRule extends PhutilRemarkupRule { foreach ($keys as $k => $v) { $v = trim($v, " \n"); $v = preg_replace('/\\\\(.)/', '\\1', $v); - if (!strlen($v)) { + if ($v === '') { unset($keys[$k]); continue; }