diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2003-01-18 20:48:52 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2003-01-18 20:48:52 +0000 |
commit | b2ecf477550ab799c82d65e9eddd5260865556bf (patch) | |
tree | d773748a7d4abf4889746a3d45f67737248f18ee /ext/pcre | |
parent | c794f2c710cf4b3701737f30a7d19a14297de8a1 (diff) | |
download | php-git-b2ecf477550ab799c82d65e9eddd5260865556bf.tar.gz |
Fixed bug #21732 (Added a sanity check, that prevents parameter mismatch).
Diffstat (limited to 'ext/pcre')
-rw-r--r-- | ext/pcre/php_pcre.c | 4 |
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(), ®ex, &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) |