Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2680501
D25748.1734558697.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
D25748.1734558697.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D25748: Fix PHP 8.1 "strlen(null)" exception on LDAP login without password
Attached
Detach File
Event Timeline
Log In to Comment