[wp-trac] [WordPress Trac] #8912: wptexturize malforms HTML comments that contain HTML tags

WordPress Trac noreply at wordpress.org
Wed Jul 10 17:51:30 UTC 2013


#8912: wptexturize malforms HTML comments that contain HTML tags
-------------------------------------------------+-------------------------
 Reporter:  Otto42                               |       Owner:  anonymous
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  Future
Component:  Formatting                           |  Release
 Severity:  normal                               |     Version:  2.7
 Keywords:  has-patch needs-refresh needs-unit-  |  Resolution:
  tests                                          |
-------------------------------------------------+-------------------------

Comment (by Cimmo):

 Actually my issue was even more subtle:
 basically I have a html comment in my plugin with just the plugin's name,
 version and author, no html tags.

 So how that triggered this bug?
 When used on certain themes they were applying to the_content() first
 wpautop() function, that transformed all new lines into html break tags
 and then applied wptexturize().

 So in that case, even if I had a totally harmless comment, but on multiple
 lines, the combination of the two functions made my "end of the html
 comment tag" changed and then all the page broke.

 This the piece that is found in some themes like: "Modular" and "Emporium"
 for "WooCommerce":

 {{{
 # Format and append to content
 $new_content .= wptexturize(wpautop($piece_intl));
 }}}

 To fix the problem I had to remove all "new lines" in my html comment.

 Just to give the idea how a bug can be amplified by pure "luck" :)

--
Ticket URL: <http://core.trac.wordpress.org/ticket/8912#comment:32>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list