Malvineous has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/190407

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

Extra 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(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LdapAuthentication 
refs/changes/07/190407/1

diff --git a/LdapAuthentication.php b/LdapAuthentication.php
index 5b258fc..500a6f1 100644
--- a/LdapAuthentication.php
+++ b/LdapAuthentication.php
@@ -1729,7 +1729,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 (( $PGentries ) && ( !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: newchange
Gerrit-Change-Id: I0334a4574b00bf5e8f6bff867b650290be8cd5f1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LdapAuthentication
Gerrit-Branch: master
Gerrit-Owner: Malvineous <[email protected]>

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

Reply via email to