Repository navigation
Commit f59de42
committed
KSES: Clarify that
`valid_unicode()` follows the XML `Char` production rather than checking whether a code point is valid Unicode. It rejects C0 controls other than tab, line feed, and carriage return, along with surrogates and U+FFFE and U+FFFF. Update its docblock to say so, and point callers to the newer Unicode and UTF-8 helpers, such as `wp_is_valid_utf8()`.
Add rejected test cases for U+000B and U+001F, which guard the boundary below U+0020, and rename the test and its data provider to describe XML `Char` acceptance.
Follow-up to [64770].
Developed in: #15105
Props shailu25, dmsnell.
Fixes #66483. See #65819.
git-svn-id: https://develop.svn.wordpress.org/trunk@65268 602fd350-edb4-49c9-b593-d223f7449a82valid_unicode() checks XML Char ranges.1 parent 135a187 commit f59de42
2 files changed
Lines changed: 21 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3403 | 3403 | | |
3404 | 3404 | | |
3405 | 3405 | | |
3406 | | - | |
| 3406 | + | |
3407 | 3407 | | |
3408 | | - | |
| 3408 | + | |
| 3409 | + | |
| 3410 | + | |
| 3411 | + | |
| 3412 | + | |
| 3413 | + | |
| 3414 | + | |
3409 | 3415 | | |
3410 | 3416 | | |
3411 | 3417 | | |
| |||
3419 | 3425 | | |
3420 | 3426 | | |
3421 | 3427 | | |
3422 | | - | |
3423 | | - | |
| 3428 | + | |
| 3429 | + | |
3424 | 3430 | | |
3425 | 3431 | | |
3426 | 3432 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
| |||
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
15 | | - | |
| 18 | + | |
16 | 19 | | |
17 | | - | |
18 | | - | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | | - | |
21 | | - | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
29 | | - | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| 45 | + | |
| 46 | + | |
42 | 47 | | |
43 | 48 | | |
44 | 49 | | |
| |||
0 commit comments