[wp-trac] [WordPress Trac] #43785: wptexturize fails to skip JavaScript if code contains <

WordPress Trac noreply at wordpress.org
Wed Jul 10 17:58:30 UTC 2024


#43785: wptexturize fails to skip JavaScript if code contains <
-------------------------------------------------+-------------------------
 Reporter:  nextendweb                           |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Formatting                           |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  wptexturize needs-patch needs-unit-  |     Focuses:
  tests                                          |
-------------------------------------------------+-------------------------
Changes (by sabernhardt):

 * keywords:   => wptexturize needs-patch needs-unit-tests
 * milestone:  Awaiting Review => Future Release


Comment:

 This likely started in 4.4.1 because it is caused by the
 [https://core.trac.wordpress.org/browser/trunk/src/wp-
 includes/formatting.php?rev=58601#L254 regex] added in [36036].

 The `wptexturize()` function already skips HTML comments (checking for
 `<!--`), but it does not continue if the `<` is between `<script` and
 `</script>`. (That might be achievable with the HTML API.)

 Unit tests should be updated to account for multiple ampersand
 possibilities within a script tag.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43785#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list