[resolved] [Plugin: Advanced Excerpt] Partial Tags at excerpt end (1 post)

  1. Dylan Kuhn
    Posted 6 years ago #

    I got an excerpt with an incomplete tag at the end:

    TheĀ <a title="Oral mucosa" href="/wiki/Oral_mucosa">oral mucosa</a> is the<a title="Mucous&hellip; </div>

    Could be a bug in force_balance_tags - I added a little fix after that call:

    $text = trim(force_balance_tags($text));
    //DKK: Remove partial tags at the end - not sure why this isn't handled in force_balance_tags
    $last_open_pos = strrpos( $text, '<' );
    $last_close_pos = strrpos( $text, '>' );
    if ( $last_open_pos > $last_close_pos ) {
    	$text = substr( $text, 0, $last_open_pos );


Topic Closed

This topic has been closed to new replies.

About this Topic