[wp-trac] [WordPress Trac] #48054: wp.sanitize.stripTags should iterate instead of using recursion
WordPress Trac
noreply at wordpress.org
Mon Sep 16 21:23:39 UTC 2019
#48054: wp.sanitize.stripTags should iterate instead of using recursion
-------------------------+-----------------------------
Reporter: jrchamp | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 5.2.3
Severity: minor | Keywords: has-patch
Focuses: |
-------------------------+-----------------------------
The changes to wp-sanitize.js seemed wasteful and like it produced dead
code in the final return.
https://github.com/WordPress/WordPress/commit/90d9bdc54c82229b3aa5a6e60d775f14b1f9a9dc
#diff-9bedaa5d6abc6cb127b2f496bb2f7835
When I got into it to fix the dead code, I also felt a way about the
recursion, because stack and memory exhaustion are two other potential
issues. So this way should *at most* be one function call and only
duplicate memory instead of being O(n*memory).
https://github.com/WordPress/WordPress/commit/d9b128f50546a65c9cf0944ee61237e35ff269c0
This is probably a drive-by commit and for that I apologize. I hope it's
more useful than not, but your mileage may vary. Thank you for making
WordPress.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48054>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list