com php-src: Fixed another part in ldap (bug #73933): ext/ldap/ldap.c ext/ldap/tests/bug73933.phpt

From: Date: Thu, 19 Jan 2017 04:23:23 +0000
Subject: com php-src: Fixed another part in ldap (bug #73933): ext/ldap/ldap.c ext/ldap/tests/bug73933.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-96808@lists.php.net to get a copy of this message
Commit: cad2598fcb80a2b3594568ced0f9a5823e98768e Author: Xinchen Hui <laruence@gmail.com> Thu, 19 Jan 2017 12:23:23 +0800 Parents: 8c75dbc4983f826c9ea9ba64930e1b91d81a73b5 Branches: PHP-7.0 PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cad2598fcb80a2b3594568ced0f9a5823e98768e Log: Fixed another part in ldap (bug #73933) Bugs: https://bugs.php.net/73933 Changed paths: M ext/ldap/ldap.c M ext/ldap/tests/bug73933.phpt Diff: diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 0fb9c75..109508b 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -1681,7 +1681,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; } @@ -1726,6 +1726,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)); @@ -1800,6 +1801,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 6bf4c07..ac934a8 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

« previous php.cvs (#96808) next »