mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-7.0' into PHP-7.1
This commit is contained in:
commit
15f94e93e7
3 changed files with 21 additions and 1 deletions
3
NEWS
3
NEWS
|
@ -18,6 +18,9 @@ PHP NEWS
|
|||
. Fixed bug #71863 (Segfault when EXPLAIN with "Unknown column" error when
|
||||
using MariaDB). (Andrey)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #72688 (preg_match missing group names in matches). (cmb)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #72661 (ReflectionType::__toString crashes with iterable).
|
||||
(Laruence)
|
||||
|
|
|
@ -261,7 +261,7 @@ static char **make_subpats_table(int num_subpats, pcre_cache_entry *pce)
|
|||
|
||||
subpat_names = (char **)ecalloc(num_subpats, sizeof(char *));
|
||||
while (ni++ < name_cnt) {
|
||||
name_idx = 0xff * (unsigned char)name_table[0] + (unsigned char)name_table[1];
|
||||
name_idx = 0x100 * (unsigned char)name_table[0] + (unsigned char)name_table[1];
|
||||
subpat_names[name_idx] = name_table + 2;
|
||||
if (is_numeric_string(subpat_names[name_idx], strlen(subpat_names[name_idx]), NULL, NULL, 0) > 0) {
|
||||
php_error_docref(NULL, E_WARNING, "Numeric named subpatterns are not allowed");
|
||||
|
|
17
ext/pcre/tests/bug72688.phpt
Normal file
17
ext/pcre/tests/bug72688.phpt
Normal file
|
@ -0,0 +1,17 @@
|
|||
--TEST--
|
||||
Bug #72688 (preg_match missing group names in matches)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$pattern = [];
|
||||
for ($i = 0; $i < 300; $i++) {
|
||||
$pattern[] = "(?'group{$i}'{$i}$)";
|
||||
}
|
||||
$fullPattern = '/' . implode('|', $pattern) . '/uix';
|
||||
|
||||
preg_match($fullPattern, '290', $matches);
|
||||
|
||||
var_dump($matches['group290']);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "290"
|
Loading…
Add table
Add a link
Reference in a new issue