com php-src: Use new zend_hash API: ext/ldap/ldap.c
| From: | Dmitry Stogov | Date: | Wed, 28 May 2014 13:49:31 +0000 |
| Subject: | com php-src: Use new zend_hash API: ext/ldap/ldap.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-78613@lists.php.net to get a copy of this message | ||
Commit: 2af311bea339544728d9bdfc1e1f4111f1189cd3
Author: Dmitry Stogov <dmitry@zend.com> Wed, 28 May 2014 17:49:31 +0400
Parents: 4affab237ddefd709408a5b2ebad53b29b213a8b
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2af311bea339544728d9bdfc1e1f4111f1189cd3
Log:
Use new zend_hash API
Changed paths:
M ext/ldap/ldap.c
Diff:
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index 6a29355..c5cb15f 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -2122,8 +2122,7 @@ PHP_FUNCTION(ldap_set_option)
ctrls = safe_emalloc((1 + ncontrols), sizeof(*ctrls), 0);
*ctrls = NULL;
ctrlp = ctrls;
- zend_hash_internal_pointer_reset(Z_ARRVAL_P(newval));
- while ((ctrlval = zend_hash_get_current_data(Z_ARRVAL_P(newval))) != NULL) {
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(newval), ctrlval) {
if (Z_TYPE_P(ctrlval) != IS_ARRAY) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The array value must contain only arrays,
where each array is a control");
error = 1;
@@ -2154,8 +2153,7 @@ PHP_FUNCTION(ldap_set_option)
++ctrlp;
*ctrlp = NULL;
- zend_hash_move_forward(Z_ARRVAL_P(newval));
- }
+ } ZEND_HASH_FOREACH_END();
if (!error) {
error = ldap_set_option(ldap, option, ctrls);
}