[wp-trac] [WordPress Trac] #51019: convert_smilies() fails on large tags
WordPress Trac
noreply at wordpress.org
Sat Dec 14 23:51:33 UTC 2024
#51019: convert_smilies() fails on large tags
-------------------------------------------------+-------------------------
Reporter: podpirate | Owner:
| SergeyBiryukov
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: 6.8
Component: Formatting | Version: 5.5
Severity: normal | Resolution:
Keywords: has-patch php80 has-unit-tests has- | Focuses:
testing-info needs-testing |
-------------------------------------------------+-------------------------
Comment (by SergeyBiryukov):
In [changeset:"59515" 59515]:
{{{
#!CommitTicketReference repository="" revision="59515"
Formatting: Check the result of `preg_split()` in `convert_smilies()`.
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.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51019#comment:35>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list