File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -197,6 +197,13 @@ public function getAttributes($minimal = false) {
197197 );
198198 }
199199
200+ // remove possible empty attributes
201+ $ attributes = array_values (
202+ array_filter ($ attributes , function ($ attributeName ) {
203+ return !empty ($ attributeName );
204+ })
205+ );
206+
200207 return $ attributes ;
201208 }
202209
Original file line number Diff line number Diff line change @@ -256,12 +256,17 @@ public function testGetAttributes($minimal) {
256256 $ manager ->setLdapAccess ($ access );
257257
258258 $ connection = $ access ->getConnection ();
259- $ connection ->setConfiguration (['ldapEmailAttribute ' => 'mail ' , 'ldapUserAvatarRule ' => 'default ' ]);
259+ $ connection ->setConfiguration ([
260+ 'ldapEmailAttribute ' => 'mail ' ,
261+ 'ldapUserAvatarRule ' => 'default ' ,
262+ 'ldapQuotaAttribute ' => '' ,
263+ ]);
260264
261265 $ attributes = $ manager ->getAttributes ($ minimal );
262266
263267 $ this ->assertTrue (in_array ('dn ' , $ attributes ));
264268 $ this ->assertTrue (in_array ($ access ->getConnection ()->ldapEmailAttribute , $ attributes ));
269+ $ this ->assertFalse (in_array ('' , $ attributes ));
265270 $ this ->assertSame (!$ minimal , in_array ('jpegphoto ' , $ attributes ));
266271 $ this ->assertSame (!$ minimal , in_array ('thumbnailphoto ' , $ attributes ));
267272 }
You can’t perform that action at this time.
0 commit comments