[buddypress-trac] [BuddyPress Trac] #6517: bp_create_excerpt returning mall-formed markup - mb_strlen issues?

buddypress-trac noreply at wordpress.org
Fri Jun 19 15:47:18 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            |   Keywords:
------------------------------+-----------------------------
 Until very recently this BP function worked happily to take a piece of
 post-post_content wrapped in wp_ksses in turn wrapped in wpautop along
 with a truncation length and BP array of args to remove ellipses.  This
 was to gain more control os a specific content piece with additional
 allowed_tags.

 This arrangement has suddenly resulted in the $length being ignored and
 full content returned as well as stray closing tags appearing at the end
 of the content (resultant when markup elements present i.e anchors)

 I re-factored my approach removing wp_ksses as we have recently upgraded
 BP allowed tags so it wasn't necessary and removing wpautop to use later
 on the returned excerpt (works fine).

 Issue still remains that links are mall-formed and looking at the function
 where we attempt to gather / strip the tags to remove from the
 character/string length count we are failing to correctly return them,
 possibly failing on out final foreach closing tags loop.

 This feels like it may be an issue with mb_strlen as I've seen it
 mentioned in another ticket and Boone alluded to the possibility WP had
 made some changes here?

 Unit test are suggested as a means of demonstrating the issue but sadly
 with zero experience of writing tests that will have to wait.

 My current tests are in a Archive post loop running a new wp_query:
 `bp_create_excerpt( $this_cat_news->post->post_content, 300,
 array('ending' => '', 'html' => true ) )`

 With the post content having a simple set of basic anchor links in the
 post body.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6517>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list