cvs: php4 /ext/standard string.c

From: Date: Fri, 16 May 2003 23:30:08 +0000
Subject: cvs: php4 /ext/standard string.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-20981@lists.php.net to get a copy of this message
pollita Fri May 16 19:30:08 2003 EDT Modified files: /php4/ext/standard string.c Log: MFB(r-1.333.2.27) Bugfix 23654. If subject is an array and it contains other arrays, we want to pass those subarrays through unchanged rather than attempt to convert them to string. Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.381 php4/ext/standard/string.c:1.382 --- php4/ext/standard/string.c:1.381 Fri May 16 02:19:51 2003 +++ php4/ext/standard/string.c Fri May 16 19:30:08 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.381 2003/05/16 06:19:51 moriyoshi Exp $ */ +/* $Id: string.c,v 1.382 2003/05/16 23:30:08 pollita Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -3162,8 +3162,12 @@ /* For each subject entry, convert it to string, then perform replacement and add the result to the return_value array. */ while (zend_hash_get_current_data(Z_ARRVAL_PP(subject), (void **)&subject_entry) == SUCCESS) { - MAKE_STD_ZVAL(result); - php_str_replace_in_subject(*search, *replace, subject_entry, result, case_sensitivity, (argc > 3) ? &count : NULL); + if (Z_TYPE_PP(subject_entry) != IS_ARRAY && Z_TYPE_PP(subject_entry) != IS_OBJECT) { + MAKE_STD_ZVAL(result); + php_str_replace_in_subject(*search, *replace, subject_entry, result, case_sensitivity, (argc > 3) ? &count : NULL); + } else { + result = *subject_entry; + } /* Add to return array */ switch (zend_hash_get_current_key_ex(Z_ARRVAL_PP(subject), &string_key, &string_key_len, &num_key, 0, NULL)) {

« previous php.cvs (#20981) next »