Commit 8071b4a
committed
Compat: Fix mb_substr() polyfill for out-of-range offsets.
The delegation to `substr()` in the `_mb_substr()` polyfill left some results returning `false` on PHP < 8.0, but `mb_substr()` always returns an empty string in these cases.
This patch updates the behavior to match `mb_substr()`. Some issues were not detected due to duplicate test names that appeared in the [60969] refactor. These have been corrected as part of this patch.
Developed in: WordPress#12302
Discussed in: https://core.trac.wordpress.org/ticket/64894
Follow-up to [60969].
Props dmsnell, soean.
See #64894.
git-svn-id: https://develop.svn.wordpress.org/trunk@62576 602fd350-edb4-49c9-b593-d223f7449a821 parent f149add commit 8071b4a
2 files changed
Lines changed: 20 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
302 | 309 | | |
303 | 310 | | |
304 | 311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
0 commit comments