Page MenuHomePhorge

D25748.1734558697.diff
No OneTemporary

D25748.1734558697.diff

diff --git a/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php b/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php
--- a/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php
+++ b/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php
@@ -142,10 +142,10 @@
$username = $request->getStr('ldap_username');
$password = $request->getStr('ldap_password');
- $has_password = strlen($password);
+ $has_password = phutil_nonempty_string($password);
$password = new PhutilOpaqueEnvelope($password);
- if (!strlen($username) || !$has_password) {
+ if (!phutil_nonempty_string($username) || !$has_password) {
$response = $controller->buildProviderPageResponse(
$this,
$this->renderLoginForm($request, 'login'));
@@ -154,7 +154,7 @@
if ($request->isFormPost()) {
try {
- if (strlen($username) && $has_password) {
+ if (phutil_nonempty_string($username) && $has_password) {
$adapter = $this->getAdapter();
$adapter->setLoginUsername($username);
$adapter->setLoginPassword($password);

File Metadata

Mime Type
text/plain
Expires
Wed, Dec 18, 21:51 (4 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1014932
Default Alt Text
D25748.1734558697.diff (1 KB)

Event Timeline