int ncontrols;
char error=0;
- if ((Z_TYPE_P(newval) != IS_ARRAY) || !(ncontrols = zend_hash_num_elements(Z_ARRVAL_P(newval)))) {
- php_error_docref(NULL, E_WARNING, "Expected non-empty array value for this option");
+ if (Z_TYPE_P(newval) != IS_ARRAY) {
+ php_error_docref(NULL, E_WARNING, "Expected array value for this option");
RETURN_FALSE;
}
+ ncontrols = zend_hash_num_elements(Z_ARRVAL_P(newval));
ctrls = safe_emalloc((1 + ncontrols), sizeof(*ctrls), 0);
*ctrls = NULL;
ctrlp = ctrls;
$controls_get[0]['iscritical'],
bin2hex($controls_get[0]['value']),
$result = ldap_search($link, $base, "(objectClass=person)", array('cn')),
- ldap_get_entries($link, $result)['count']
+ ldap_get_entries($link, $result)['count'],
+ ldap_set_option($link, LDAP_OPT_SERVER_CONTROLS, array()),
+ ldap_get_option($link, LDAP_OPT_SERVER_CONTROLS, $controls_get)
);
?>
===DONE===
string(14) "30050201010400"
resource(%d) of type (ldap result)
int(1)
+bool(true)
+bool(false)
===DONE===