cvs: php4 /ext/pcre php_pcre.c

From: Date: Wed, 17 Oct 2001 18:20:19 +0000
Subject: cvs: php4 /ext/pcre php_pcre.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-7840@lists.php.net to get a copy of this message
andrei Wed Oct 17 14:20:19 2001 EDT Modified files: /php4/ext/pcre php_pcre.c Log: @- Fixed a bug in preg_replace() that would change the type of the replacement @ array entries to string. (Andrei) Index: php4/ext/pcre/php_pcre.c diff -u php4/ext/pcre/php_pcre.c:1.110 php4/ext/pcre/php_pcre.c:1.111 --- php4/ext/pcre/php_pcre.c:1.110 Thu Oct 11 19:33:38 2001 +++ php4/ext/pcre/php_pcre.c Wed Oct 17 14:20:19 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_pcre.c,v 1.110 2001/10/11 23:33:38 ssb Exp $ */ +/* $Id: php_pcre.c,v 1.111 2001/10/17 18:20:19 andrei Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -704,7 +704,6 @@ return NULL; } } else { - convert_to_string(replace_val); replace = Z_STRVAL_P(replace_val); replace_len = Z_STRLEN_P(replace_val); replace_end = replace + replace_len; @@ -906,6 +905,9 @@ if (Z_TYPE_P(replace) == IS_ARRAY && !is_callable_replace) { /* Get current entry */ if (zend_hash_get_current_data(Z_ARRVAL_P(replace), (void **)&replace_entry) == SUCCESS) { + if (!is_callable_replace) { + convert_to_string_ex(replace_entry); + } replace_value = *replace_entry; zend_hash_move_forward(Z_ARRVAL_P(replace)); } else {

« previous php.cvs (#7840) next »