forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport fix phpGH-17280: ldap_search() fails when $attributes array …
…has holes Backport of phpGH-17284 to fix phpGH-17280 on lower branches.
- Loading branch information
Showing
4 changed files
with
78 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--TEST-- | ||
GH-17280 (ldap_search() fails when $attributes array has holes) | ||
--EXTENSIONS-- | ||
ldap | ||
--FILE-- | ||
<?php | ||
|
||
/* We are assuming 3333 is not connectable */ | ||
$ldap = ldap_connect('ldap://127.0.0.1:3333'); | ||
|
||
// Creating an array with a hole in it | ||
$attr = array_unique(['cn', 'uid', 'uid', 'mail']); | ||
var_dump(ldap_search($ldap, 'ou=people,dc=example,dc=com', 'uid=admin', $attr)); | ||
|
||
?> | ||
--EXPECTF-- | ||
Warning: ldap_search(): Search: Can't contact LDAP server in %s on line %d | ||
bool(false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters