cvs: php-src(PHP_5_0) / NEWS /ext/ldap ldap.c

From: Date: Sat, 09 Jul 2005 00:47:02 +0000
Subject: cvs: php-src(PHP_5_0) / NEWS /ext/ldap ldap.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-32827@lists.php.net to get a copy of this message
sniper Fri Jul 8 20:47:02 2005 EDT Modified files: (Branch: PHP_5_0) /php-src NEWS /php-src/ext/ldap ldap.c Log: MFH http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.449&r2=1.1760.2.450&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1760.2.449 php-src/NEWS:1.1760.2.450 --- php-src/NEWS:1.1760.2.449 Tue Jul 5 08:47:05 2005 +++ php-src/NEWS Fri Jul 8 20:47:00 2005 @@ -16,6 +16,7 @@ - Fixed memory corruption in ImageTTFText() with 64bit systems. (Andrey) - Fixed memory corruption in stristr(). (Derick) - Fixed segfaults when CURL callback functions throw exception. (Tony) +- Fixed bug #33588 (LDAP: RootDSE query not possible). (Jani) - Fixed bug #33520 (crash if safe_mode is on and session.save_path is changed). (Dmitry) - Fixed bug #33491 (crash after extending MySQLi internal class). (Tony) http://cvs.php.net/diff.php/php-src/ext/ldap/ldap.c?r1=1.154.2.5&r2=1.154.2.6&ty=u Index: php-src/ext/ldap/ldap.c diff -u php-src/ext/ldap/ldap.c:1.154.2.5 php-src/ext/ldap/ldap.c:1.154.2.6 --- php-src/ext/ldap/ldap.c:1.154.2.5 Sun May 8 11:44:15 2005 +++ php-src/ext/ldap/ldap.c Fri Jul 8 20:47:01 2005 @@ -22,7 +22,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: ldap.c,v 1.154.2.5 2005/05/08 15:44:15 sniper Exp $ */ +/* $Id: ldap.c,v 1.154.2.6 2005/07/09 00:47:01 sniper Exp $ */ #define IS_EXT_MODULE #ifdef HAVE_CONFIG_H @@ -314,7 +314,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "LDAP Support", "enabled"); - php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.154.2.5 2005/05/08 15:44:15 sniper Exp $"); + php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.154.2.6 2005/07/09 00:47:01 sniper Exp $"); if (LDAPG(max_links) == -1) { snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links)); @@ -727,8 +727,12 @@ if (Z_TYPE_PP(link) != IS_ARRAY) { convert_to_string_ex(filter); ldap_filter = Z_STRVAL_PP(filter); - convert_to_string_ex(base_dn); - ldap_base_dn = Z_STRVAL_PP(base_dn); + + /* If anything else than string is passed, ldap_base_dn = NULL */ + if (Z_TYPE_PP(base_dn) == IS_STRING) { + convert_to_string_ex(base_dn); + ldap_base_dn = Z_STRVAL_PP(base_dn); + } } break; @@ -764,8 +768,13 @@ zend_hash_internal_pointer_reset(Z_ARRVAL_PP(base_dn)); } else { nbases = 0; /* this means string, not array */ - convert_to_string_ex(base_dn); - ldap_base_dn = Z_STRLEN_PP(base_dn) < 1 ? NULL : Z_STRVAL_PP(base_dn); + /* If anything else than string is passed, ldap_base_dn = NULL */ + if (Z_TYPE_PP(base_dn) == IS_STRING) { + convert_to_string_ex(base_dn); + ldap_base_dn = Z_STRVAL_PP(base_dn); + } else { + ldap_base_dn = NULL; + } } if (Z_TYPE_PP(filter) == IS_ARRAY) { @@ -803,8 +812,14 @@ if (nbases != 0) { /* base_dn an array? */ zend_hash_get_current_data(Z_ARRVAL_PP(base_dn), (void **)&entry); zend_hash_move_forward(Z_ARRVAL_PP(base_dn)); - convert_to_string_ex(entry); - ldap_base_dn = Z_STRLEN_PP(entry) < 1 ? NULL : Z_STRVAL_PP(entry); + + /* If anything else than string is passed, ldap_base_dn = NULL */ + if (Z_TYPE_PP(entry) == IS_STRING) { + convert_to_string_ex(entry); + ldap_base_dn = Z_STRVAL_PP(entry); + } else { + ldap_base_dn = NULL; + } } if (nfilters != 0) { /* filter an array? */ zend_hash_get_current_data(Z_ARRVAL_PP(filter), (void **)&entry); @@ -845,11 +860,6 @@ return; } - /* fix to make null base_dn's work */ - if (strlen(ldap_base_dn) < 1) { - ldap_base_dn = NULL; - } - ld = (ldap_linkdata *) zend_fetch_resource(link TSRMLS_CC, -1, "ldap link", NULL, 1, le_link); if (ld == NULL) { if (ldap_attrs != NULL) {

« previous php.cvs (#32827) next »