diff options
author | Anatol Belski <ab@php.net> | 2018-12-01 10:28:56 +0100 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2018-12-01 10:28:56 +0100 |
commit | 31f28961a7a1767af630357d90f90ea59bc795cd (patch) | |
tree | 6fd06e182405bc0ad5561e71635b98e7e6fb98c8 /ext/pcre/tests | |
parent | 12410df5fb38cd092d29f67006e4ba22463068da (diff) | |
parent | ef1269d5c158afaf052e3d79591462e0f5372b1a (diff) | |
download | php-git-31f28961a7a1767af630357d90f90ea59bc795cd.tar.gz |
Merge branch 'PHP-7.3'
* PHP-7.3:
Fixed bug #77193 Infinite loop in preg_replace_callback
Diffstat (limited to 'ext/pcre/tests')
-rw-r--r-- | ext/pcre/tests/bug77193.phpt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ext/pcre/tests/bug77193.phpt b/ext/pcre/tests/bug77193.phpt new file mode 100644 index 0000000000..5dc7913db2 --- /dev/null +++ b/ext/pcre/tests/bug77193.phpt @@ -0,0 +1,27 @@ +--TEST-- +Bug #77193 Infinite loop in preg_replace_callback +--SKIPIF-- +<?php + if (!extension_loaded("filter")) { + die("skip need filter extension"); + } +?> +--FILE-- +<?php +$text = '{CCM:CID_2}'; +echo '1'; +$mt = array(); +preg_replace_callback( + '/([0-9]+)/i', + function ($matches) { + echo $matches[1]; + filter_var('http', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => '/^http$/i']]); + }, + $text +); +echo '3', "\n"; +?> +===DONE=== +--EXPECT-- +123 +===DONE=== |