[wp-trac] [WordPress Trac] #51019: convert_smilies() fails on large tags

WordPress Trac noreply at wordpress.org
Tue Jun 25 18:05:21 UTC 2024


#51019: convert_smilies() fails on large tags
-------------------------------------------------+-------------------------
 Reporter:  podpirate                            |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  6.7
Component:  Formatting                           |     Version:  5.5
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch php80 has-unit-tests has-  |     Focuses:
  testing-info needs-testing                     |
-------------------------------------------------+-------------------------

Comment (by dmsnell):

 This same bug was recently discussed within Automattic and @bjorsch
 identified a problem with the regex being written in a way that invites
 unrestrained backtracking.

 Converting `'/(<.*>)/U'` into `/(<[^>]*>/U` would likely resolve this
 particular problem, as it would get rid of all the backtracking when
 attempting to poorly segment the HTML.

 A more comprehensive fix that I've proposed making is to replace this code
 altogether with the HTML API, which will eliminate a number of bugs,
 including this one.

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


More information about the wp-trac mailing list