]> granicus.if.org Git - php/commitdiff
Fixed bug #21758
authorMoriyoshi Koizumi <moriyoshi@php.net>
Mon, 20 Jan 2003 16:45:21 +0000 (16:45 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Mon, 20 Jan 2003 16:45:21 +0000 (16:45 +0000)
ext/pcre/php_pcre.c

index d777c47dd69c46c710825d7f033e96ba12b76e25..3f5ef9a263130ce2eeae3356ef6a0333c36769f7 100644 (file)
@@ -1044,7 +1044,7 @@ 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) {
+       if (!is_callable_replace && 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;
        }