diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2019-03-19 13:59:43 +0100 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-03-19 13:59:43 +0100 |
| commit | 2783670daa7831b61937ab91f5d2cd84d63de5fd (patch) | |
| tree | 091ba417c3c1619080724eeabbe93b00d0ed2902 /ext/pcre/tests | |
| parent | 4fe3d108af2b0a1e8810959fe1ea7a0b52291ad7 (diff) | |
| parent | 661bce47aebdc67bda1616e1b6979803765173a6 (diff) | |
| download | php-git-2783670daa7831b61937ab91f5d2cd84d63de5fd.tar.gz | |
Merge branch 'PHP-7.3' into PHP-7.4
Diffstat (limited to 'ext/pcre/tests')
| -rw-r--r-- | ext/pcre/tests/bug70345.phpt | 8 | ||||
| -rw-r--r-- | ext/pcre/tests/bug76127.phpt | 10 | ||||
| -rw-r--r-- | ext/pcre/tests/split2.phpt | 5 |
3 files changed, 13 insertions, 10 deletions
diff --git a/ext/pcre/tests/bug70345.phpt b/ext/pcre/tests/bug70345.phpt index 0947ba3daa..187a3e1e6f 100644 --- a/ext/pcre/tests/bug70345.phpt +++ b/ext/pcre/tests/bug70345.phpt @@ -5,8 +5,7 @@ Bug #70345 (Multiple vulnerabilities related to PCRE functions) $regex = '/(?=xyz\K)/'; $subject = "aaaaxyzaaaa"; -$v = preg_split($regex, $subject); -print_r($v); +var_dump(preg_split($regex, $subject)); $regex = '/(a(?=xyz\K))/'; $subject = "aaaaxyzaaaa"; @@ -14,10 +13,7 @@ preg_match($regex, $subject, $matches); var_dump($matches); --EXPECTF-- -Array -( - [0] => aaaaxyzaaaa -) +bool(false) Warning: preg_match(): Get subpatterns list failed in %s on line %d array(0) { diff --git a/ext/pcre/tests/bug76127.phpt b/ext/pcre/tests/bug76127.phpt new file mode 100644 index 0000000000..710a221692 --- /dev/null +++ b/ext/pcre/tests/bug76127.phpt @@ -0,0 +1,10 @@ +--TEST-- +Bug #76127: preg_split does not raise an error on invalid UTF-8 +--FILE-- +<?php +var_dump(preg_split("/a/u", "a\xff")); +var_dump(preg_last_error() == PREG_BAD_UTF8_ERROR); +?> +--EXPECT-- +bool(false) +bool(true) diff --git a/ext/pcre/tests/split2.phpt b/ext/pcre/tests/split2.phpt index b0411e6df2..5c77c6d1bc 100644 --- a/ext/pcre/tests/split2.phpt +++ b/ext/pcre/tests/split2.phpt @@ -310,8 +310,5 @@ array(6) { Warning: preg_last_error() expects exactly 0 parameters, 1 given in %s on line %d NULL bool(true) -array(1) { - [0]=> - string(6) "ab2c3u" -} +bool(false) bool(true) |
