diff --git a/src/applications/auth/factor/PhabricatorAuthFactor.php b/src/applications/auth/factor/PhabricatorAuthFactor.php index fefd9b5fd1..79ea17de7f 100644 --- a/src/applications/auth/factor/PhabricatorAuthFactor.php +++ b/src/applications/auth/factor/PhabricatorAuthFactor.php @@ -413,8 +413,8 @@ abstract class PhabricatorAuthFactor extends Phobject { $sync_type = PhabricatorAuthMFASyncTemporaryTokenType::TOKENTYPE; $sync_token = null; - $sync_key = $request->getStr($this->getMFASyncTokenFormKey()); - if (strlen($sync_key)) { + $sync_key = $request->getStr($this->getMFASyncTokenFormKey(), ''); + if ($sync_key !== '') { $sync_key_digest = PhabricatorHash::digestWithNamedKey( $sync_key, PhabricatorAuthMFASyncTemporaryTokenType::DIGEST_KEY); diff --git a/src/applications/settings/panel/PhabricatorMultiFactorSettingsPanel.php b/src/applications/settings/panel/PhabricatorMultiFactorSettingsPanel.php index 0054610c28..492544bef6 100644 --- a/src/applications/settings/panel/PhabricatorMultiFactorSettingsPanel.php +++ b/src/applications/settings/panel/PhabricatorMultiFactorSettingsPanel.php @@ -257,7 +257,7 @@ final class PhabricatorMultiFactorSettingsPanel // example, with SMS). if (!$request->isFormPost() || !$request->getBool('mfa.start')) { $enroll = $selected_provider->getEnrollMessage(); - if (!strlen($enroll)) { + if (!phutil_nonempty_string($enroll)) { $enroll = $selected_provider->getEnrollDescription($viewer); }