[buddypress-trac] [BuddyPress Trac] #6517: bp_create_excerpt returning mall-formed markup - mb_strlen issues?
buddypress-trac
noreply at wordpress.org
Sat Jun 20 15:12:51 UTC 2015
#6517: bp_create_excerpt returning mall-formed markup - mb_strlen issues?
------------------------------+------------------------------
Reporter: hnla | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Component - Core | Version:
Severity: normal | Resolution:
Keywords: |
------------------------------+------------------------------
Comment (by hnla):
This should demonstrate the issue, I've been trying out various
combinations of markup, links are commented as showing linked characters
that shouldn't be e.g '/a' but they are simply a consequence of this
malformed angle tag re-introduction after stripping from the character
count, I have though seen this linking extend to a whole paragraph or end
of returned excerpt so is an issue when ideal conditions encountered.
{{{
function bp_excerpt_truncation_issue_trac6517() {
$test_content = '<p>This test content demonstrates an issue
with truncating a long string run through the bp_create_excerpt function
and which has pcdata</p>
<p>The issue manifests when we have tags to process (note the html arg in
the function that removes the characters
representing parsed data tags from the truncated string length return)
<i>at this point
it would be noted that we now have stray closing angle brackets at the end
of the text </i></p>
If we now add link markup into the content body we will see mal-formed
tags causing incorrect wrapping of the text.
We now link to one of the <a href="http://buddypress.org/"> really awsome
sites on the net </a> and observe that the text link
is now looking a little odd <a href="http://google.com/">when I add
another link into the mix</a> observe how we now
include in the link the partial closing anchor tag but without the less
than angle bracket.
<p>The issue ? clearly appears to be one of incorrectly returning the tag
characters
after stripping out our loop counting is off? a link right at the end
<a
href="http://https://buddypress.trac.wordpress.org/ticket/6517#comment:3">to
the trac ticket</a>
breaks including partial linked tag characters</p>';
$excerpt_test = bp_create_excerpt( $test_content , 350, array('ending' =>
'', 'html' => true ) );
echo $excerpt_test;
}
}}}
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6517#comment:4>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list