Commit 0a03d10
committed
ext/pcre: fix duplicate MARK key in matches array
When a named capture group is also called "MARK" and the pattern uses
the (*MARK:name) directive, populate_subpat_array() inserted two
buckets with the same string key into the matches array.
zend_hash_str_add_new skips the duplicate-key check, so the named
capture's MARK and the directive's MARK both landed in the table.
Switch to zend_hash_str_update so the directive's value overwrites
the capture's value, restoring the behavior that existed via
add_assoc_string_ex before d6cc31c.
Closes GH-220291 parent 48d588d commit 0a03d10
2 files changed
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1079 | 1079 | | |
1080 | 1080 | | |
1081 | 1081 | | |
1082 | | - | |
| 1082 | + | |
1083 | 1083 | | |
1084 | 1084 | | |
1085 | 1085 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
0 commit comments