cvs: php4 /ext/pcre php_pcre.c

From: Date: Sat, 18 Jan 2003 20:48:52 +0000
Subject: cvs: php4 /ext/pcre php_pcre.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-18023@lists.php.net to get a copy of this message
iliaa Sat Jan 18 15:48:52 2003 EDT Modified files: /php4/ext/pcre php_pcre.c Log: Fixed bug #21732 (Added a sanity check, that prevents parameter mismatch). Index: php4/ext/pcre/php_pcre.c diff -u php4/ext/pcre/php_pcre.c:1.134 php4/ext/pcre/php_pcre.c:1.135 --- php4/ext/pcre/php_pcre.c:1.134 Tue Dec 31 11:07:12 2002 +++ php4/ext/pcre/php_pcre.c Sat Jan 18 15:48:52 2003 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_pcre.c,v 1.134 2002/12/31 16:07:12 sebastian Exp $ */ +/* $Id: php_pcre.c,v 1.135 2003/01/18 20:48:52 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1043,6 +1043,10 @@ if (ZEND_NUM_ARGS() < 3 || ZEND_NUM_ARGS() > 4 || zend_get_parameters_ex(ZEND_NUM_ARGS(), &regex, &replace, &subject, &limit) == FAILURE) { WRONG_PARAM_COUNT; + } + if (Z_TYPE_PP(replace) == IS_ARRAY && Z_TYPE_PP(regex) != IS_ARRAY) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter mismatch, pattern is a string while replacement in an array."); + RETURN_FALSE; } SEPARATE_ZVAL(replace);

« previous php.cvs (#18023) next »