mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix GH-17704: ldap_search fails when $attributes contains a non-packed array with numerical keys
Closes GH-17710.
This commit is contained in:
4
NEWS
4
NEWS
@@ -12,6 +12,10 @@ PHP NEWS
|
||||
zend.exception_ignore_args=1 into account). (timwolla)
|
||||
. Fix fallback paths in fast_long_{add,sub}_function. (nielsdos)
|
||||
|
||||
- LDAP:
|
||||
. Fixed bug GH-17704 (ldap_search fails when $attributes contains a
|
||||
non-packed array with numerical keys). (nielsdos, 7u83)
|
||||
|
||||
- MBString:
|
||||
. Fixed bug GH-17503 (Undefined float conversion in mb_convert_variables).
|
||||
(cmb)
|
||||
|
||||
@@ -248,7 +248,7 @@ static bool php_ldap_is_numerically_indexed_array(zend_array *arr)
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* {{{ Parse controls from and to arrays */
|
||||
|
||||
24
ext/ldap/tests/gh17704.phpt
Normal file
24
ext/ldap/tests/gh17704.phpt
Normal file
@@ -0,0 +1,24 @@
|
||||
--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, "(o=*)", $attributes));
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(LDAP\Result)#%d (0) {
|
||||
}
|
||||
Reference in New Issue
Block a user