diff options
author | Xinchen Hui <laruence@gmail.com> | 2017-01-19 12:24:04 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2017-01-19 12:24:04 +0800 |
commit | 0311dc86978ac3d20a7a8d7e502e2e0b6fd6dc46 (patch) | |
tree | e8356df83890f2b613100ffdeb61e86659dd9db1 /ext/ldap | |
parent | 60d075aa655a4dafcaa59f6e5b062e4ba3a7421a (diff) | |
parent | 5e090311446819d9396b756ac33529c52220a8aa (diff) | |
download | php-git-0311dc86978ac3d20a7a8d7e502e2e0b6fd6dc46.tar.gz |
Merge branch 'PHP-7.1'
* PHP-7.1:
Fixed another part in ldap (bug #73933)
Diffstat (limited to 'ext/ldap')
-rw-r--r-- | ext/ldap/ldap.c | 4 | ||||
-rw-r--r-- | ext/ldap/tests/bug73933.phpt | 10 |
2 files changed, 13 insertions, 1 deletions
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 69dde92e94..6d2de18d61 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -1724,7 +1724,7 @@ PHP_FUNCTION(ldap_modify_batch) ); */ - if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa", &link, &dn, &dn_len, &mods) != SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa/", &link, &dn, &dn_len, &mods) != SUCCESS) { return; } @@ -1769,6 +1769,7 @@ PHP_FUNCTION(ldap_modify_batch) RETURN_FALSE; } + SEPARATE_ARRAY(mod); /* for the modification hashtable... */ zend_hash_internal_pointer_reset(Z_ARRVAL_P(mod)); num_modprops = zend_hash_num_elements(Z_ARRVAL_P(mod)); @@ -1843,6 +1844,7 @@ PHP_FUNCTION(ldap_modify_batch) RETURN_FALSE; } + SEPARATE_ARRAY(modinfo); /* is the array not empty? */ zend_hash_internal_pointer_reset(Z_ARRVAL_P(modinfo)); num_modvals = zend_hash_num_elements(Z_ARRVAL_P(modinfo)); diff --git a/ext/ldap/tests/bug73933.phpt b/ext/ldap/tests/bug73933.phpt index 6bf4c078e3..ac934a8dd8 100644 --- a/ext/ldap/tests/bug73933.phpt +++ b/ext/ldap/tests/bug73933.phpt @@ -13,8 +13,18 @@ ldap_mod_replace($ldap, null, array( 'lockoutTime' => array(0), )); +ldap_modify_batch($ldap, null, array( [ + "attrib" => "mail", + "modtype" => LDAP_MODIFY_BATCH_ADD, + "values" => [ + "test@example.com", + "test-2@example.com", ]])); + + ldap_close($ldap); ?> --EXPECTF-- Warning: ldap_mod_replace(): Modify: Can't contact LDAP server in %sbug73933.php on line %d + +Warning: ldap_modify_batch(): Batch Modify: Can't contact LDAP server in %sbug73933.php on line %d |