jenkins-bot has submitted this change and it was merged.

Change subject: Tighter check to confirm a variable is empty
......................................................................


Tighter check to confirm a variable is empty

When performing nested group search in AD, disabling $wgLDAPGroupsUseMemberOf
will cause many error messages to appear.  This extra check makes all those
errors go away.

Change-Id: I0334a4574b00bf5e8f6bff867b650290be8cd5f1
---
M LdapAuthentication.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Chad: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/LdapAuthentication.php b/LdapAuthentication.php
index b8df942..362ffee 100644
--- a/LdapAuthentication.php
+++ b/LdapAuthentication.php
@@ -1722,7 +1722,7 @@
                        $this->printDebug( "User Filter: $PGfilter", SENSITIVE 
);
                        $PGinfo = LdapAuthenticationPlugin::ldap_search( 
$this->ldapconn, $base, $PGfilter );
                        $PGentries = 
LdapAuthenticationPlugin::ldap_get_entries( $this->ldapconn, $PGinfo );
-                       if ( $PGentries ) {
+                       if ( !empty( $PGentries[0] ) ) {
                                $Usid = $PGentries[0]['objectsid'][0];
                                $PGrid = $PGentries[0]['primarygroupid'][0];
                                $PGsid = bin2hex( $Usid );

-- 
To view, visit https://gerrit.wikimedia.org/r/190407
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0334a4574b00bf5e8f6bff867b650290be8cd5f1
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/LdapAuthentication
Gerrit-Branch: master
Gerrit-Owner: Malvineous <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to