Commit c3c319e
committed
Formatting: Check the result of
This aims to avoid a fatal error from `count()` when `preg_split()` fails on large input.
Includes:
* Optimizing the regular expression used to split the input by tags to avoid unlimited backtracking for better performance.
* Adjusting the function logic for better readability.
Follow-up to [340], [4380], [26191].
Props podpirate, nathkrill, rajinsharwar, dmsnell, bjorsch, q0rban, audrasjb, rupw, Ov3rfly, jorbin, nhrrob, chaion07, mcqueen22, azaozz, narenin, roybellingan, SergeyBiryukov.
See #51019.
git-svn-id: https://develop.svn.wordpress.org/trunk@59515 602fd350-edb4-49c9-b593-d223f7449a82preg_split() in convert_smilies().1 parent b03c9f5 commit c3c319e
File tree
2 files changed
+47
-26
lines changed- src/wp-includes
- tests/phpunit/tests/formatting
2 files changed
+47
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3473 | 3473 | | |
3474 | 3474 | | |
3475 | 3475 | | |
3476 | | - | |
3477 | | - | |
3478 | | - | |
3479 | | - | |
3480 | | - | |
3481 | 3476 | | |
3482 | | - | |
3483 | | - | |
3484 | | - | |
| 3477 | + | |
| 3478 | + | |
| 3479 | + | |
| 3480 | + | |
3485 | 3481 | | |
3486 | | - | |
3487 | | - | |
| 3482 | + | |
| 3483 | + | |
3488 | 3484 | | |
3489 | | - | |
3490 | | - | |
3491 | | - | |
3492 | | - | |
| 3485 | + | |
| 3486 | + | |
| 3487 | + | |
| 3488 | + | |
3493 | 3489 | | |
3494 | | - | |
3495 | | - | |
3496 | | - | |
3497 | | - | |
| 3490 | + | |
| 3491 | + | |
| 3492 | + | |
3498 | 3493 | | |
3499 | | - | |
3500 | | - | |
3501 | | - | |
3502 | | - | |
| 3494 | + | |
| 3495 | + | |
| 3496 | + | |
| 3497 | + | |
| 3498 | + | |
| 3499 | + | |
3503 | 3500 | | |
3504 | | - | |
| 3501 | + | |
| 3502 | + | |
| 3503 | + | |
3505 | 3504 | | |
3506 | | - | |
3507 | | - | |
3508 | | - | |
| 3505 | + | |
| 3506 | + | |
| 3507 | + | |
| 3508 | + | |
| 3509 | + | |
| 3510 | + | |
| 3511 | + | |
| 3512 | + | |
| 3513 | + | |
| 3514 | + | |
| 3515 | + | |
| 3516 | + | |
3509 | 3517 | | |
| 3518 | + | |
3510 | 3519 | | |
3511 | 3520 | | |
3512 | 3521 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
396 | 408 | | |
0 commit comments