Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/ldap/ldap.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ static bool php_ldap_is_numerically_indexed_array(zend_array *arr)
}
} ZEND_HASH_FOREACH_END();

return false;
return true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah that s unfortunate !

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I bet this happened during the downwards merge. This was fixed first in master, and then needed a slightly different patch on 8.3-8.4. It's right on master but wrong on 8.3-8.4, so something must've gone wrong while merging

}

/* {{{ Parse controls from and to arrays */
Expand Down
23 changes: 23 additions & 0 deletions ext/ldap/tests/gh17704.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
--TEST--
GH-17704 (ldap_search fails when $attributes contains a non-packed array with numerical keys)
--EXTENSIONS--
ldap
--SKIPIF--
<?php
require_once('skipifbindfailure.inc');
?>
--FILE--
<?php
include "connect.inc";

$link = ldap_connect_and_bind($uri, $user, $passwd, $protocol_version);

$attributes = ["uid", "cn"];
// force a non-packed array
$attributes['x']="x"; unset($attributes['x']);

var_dump(ldap_search($link, $base, attributes: $attributes));
?>
--EXPECTF--
object(LDAP\Result)#%d (0) {
}
Loading