Skip to content

Commit 459fc9d

Browse files
committed
Merge branch 'PHP-8.4'
* PHP-8.4: Fix GH-17704: ldap_search fails when $attributes contains a non-packed array with numerical keys
2 parents 78714d0 + e3a2306 commit 459fc9d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

ext/ldap/tests/gh17704.phpt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
GH-17704 (ldap_search fails when $attributes contains a non-packed array with numerical keys)
3+
--EXTENSIONS--
4+
ldap
5+
--SKIPIF--
6+
<?php
7+
require_once('skipifbindfailure.inc');
8+
?>
9+
--FILE--
10+
<?php
11+
include "connect.inc";
12+
13+
$link = ldap_connect_and_bind($uri, $user, $passwd, $protocol_version);
14+
15+
$attributes = ["uid", "cn"];
16+
// force a non-packed array
17+
$attributes["x"] = "x";
18+
unset($attributes["x"]);
19+
20+
var_dump(ldap_search($link, $base, "(o=*)", $attributes));
21+
?>
22+
--EXPECTF--
23+
object(LDAP\Result)#%d (0) {
24+
}

0 commit comments

Comments
 (0)