Skip to:
Content

BuddyPress.org

Changeset 9523


Ignore:
Timestamp:
02/22/2015 01:07:08 AM (10 years ago)
Author:
boonebgorges
Message:

In bp_create_excerpt(), recognize HTML comments when exclude HTML from counts.

This prevents problems with, among other things, the <!--more--> tag in
activity streams.

Fixes #3680.

Location:
trunk
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-template.php

    r9517 r9523  
    659659        $truncate    = '';
    660660
    661         // Find all the tags and put them in a stack for later use
    662         preg_match_all( '/(<\/?([\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER );
     661        // Find all the tags and HTML comments and put them in a stack for later use
     662        preg_match_all( '/(<\/?([\w!].+?)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER );
     663
    663664        foreach ( $tags as $tag ) {
    664 
    665665            // Process tags that need to be closed
    666666            if ( !preg_match( '/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s',  $tag[2] ) ) {
Note: See TracChangeset for help on using the changeset viewer.