[wp-trac] [WordPress Trac] #26674: The get_tag_regex() function is a too greedy when searching for a closing tag.

WordPress Trac noreply at wordpress.org
Mon May 12 17:19:04 UTC 2014


#26674: The get_tag_regex() function is a too greedy when searching for a closing
tag.
-------------------------------------+-----------------------------
 Reporter:  kopepasah                |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Future Release
Component:  Formatting               |     Version:  3.9
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+-----------------------------

Comment (by afercia):

 hi,
 playing with the [http://wordpress.org/themes/singl Singl theme] today I
 noticed the mess when there are multiple embeds of the same type, and came
 to a patch very similar to @Kopepasah one. I've seen also related #26675.
 Just one thing about the regex: self-closing embed tags may or may not
 have a trailing space and slash so I would just change the last part with
 this

 {{{
 |\s*?\/?>
 }}}

 where first ? makes the space quantifier lazy and second ? makes the slash
 optional.
 The unit test should also be updated to test for a self-closing tag
 without space nor slash.

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


More information about the wp-trac mailing list