[wp-trac] [WordPress Trac] #16405: filter escaping close comment only

WordPress Trac wp-trac at lists.automattic.com
Sat Jan 29 06:24:43 UTC 2011

#16405: filter escaping close comment only
 Reporter:  pehrlich      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
 WP 3.0.4

 With this code on a page:

 "wegege<!-- asd> -->ertgew"

 the opening comment does not get escaped, while the closing does.  Used in
 the following test code, which is used to display child pages on a parent

       global $post;
         $args = array(
   'post_type' => 'page',
   'numberposts' => 10,
   'post_status' => 'publish',
   'post_parent' => $post->ID,

   $attachments = get_posts($args);
   if ($attachments && is_page())
     foreach ($attachments as $post)
       echo '<div class="box"> ';
       echo apply_filters('the_content', $post->post_content);
 //      echo  $post->post_content;
       echo '</div>';

 Note that this snippet, in comparison, works correctly:

 "wegege<!-- > -->ertgew"

Ticket URL: <http://core.trac.wordpress.org/ticket/16405>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list