summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2003-01-18 20:49:02 +0000
committerIlia Alshanetsky <iliaa@php.net>2003-01-18 20:49:02 +0000
commit6c7c785e9dd013465b7bdf83ac402eed2ffb387d (patch)
tree1ddfaa561b672bfd3b2a5750e431fb6071f84d97 /ext/pcre/php_pcre.c
parent14b549692eb0cff3da2182c9fdd4d29ca32940d2 (diff)
downloadphp-git-6c7c785e9dd013465b7bdf83ac402eed2ffb387d.tar.gz
MFH
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 6776bc02dc..5bd8204410 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -1044,6 +1044,10 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_callabl
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);
if (Z_TYPE_PP(replace) != IS_ARRAY)