]> granicus.if.org Git - php/commitdiff
MFH
authorIlia Alshanetsky <iliaa@php.net>
Sat, 18 Jan 2003 20:49:02 +0000 (20:49 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sat, 18 Jan 2003 20:49:02 +0000 (20:49 +0000)
ext/pcre/php_pcre.c

index 6776bc02dcb19d816d87cd11a18039b2c868e88c..5bd8204410a2507886af5a89717a9cfd7334133d 100644 (file)
@@ -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)