Commit 8371c5c
committed
Collaboration: Cap client_id at the storage column width.
Add a maxLength constraint to the client_id argument schema so
overlong values are rejected at the REST layer rather than being
silently truncated (or erroring) at the database. The 32-character
limit matches the client_id varchar(32) column in schema.php and
mirrors the approach already used for the room argument.
Also document why both minimum and minLength are present: client_id
has a union type (string|integer), and WordPress REST API validation
dispatches string values to minLength/maxLength and integer values to
minimum, so both keywords are required to bound each branch of the
union.1 parent f2730e7 commit 8371c5c
2 files changed
Lines changed: 40 additions & 0 deletions
File tree
- src/wp-includes/collaboration
- tests/phpunit/tests/rest-api
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
154 | 159 | | |
155 | 160 | | |
156 | 161 | | |
| 162 | + | |
157 | 163 | | |
158 | 164 | | |
159 | 165 | | |
| |||
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
515 | 549 | | |
516 | 550 | | |
517 | 551 | | |
| |||
0 commit comments