Repository navigation
Commit a58b494
committed
Avoid a PCRE bug with a negated set of one character
When ignoring case, PCRE 10.32 to 10.39 with JIT can match only a part
of a character with a negated set of one character whose letter has more
than one other case, like "[^s]". On "日", it matched two of the three
bytes, so REGEXP_SUBSTR() or REGEXP_REPLACE() could return invalid
UTF-8. PHP 7.3 to 8.1 bundle these versions.
Repeat the character in such a set. PCRE then compiles a class, which
doesn't have the bug.1 parent c17c0cf commit a58b494
2 files changed
Lines changed: 18 additions & 0 deletions
File tree
- packages/mysql-on-sqlite
- src/icu
- tests/icu
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
356 | 364 | | |
357 | 365 | | |
358 | 366 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
856 | 856 | | |
857 | 857 | | |
858 | 858 | | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
859 | 869 | | |
860 | 870 | | |
861 | 871 | | |
| |||
0 commit comments