Skip to:
Content

Opened 4 years ago

Closed 3 years ago

#2443 closed defect (bug) (fixed)

Make sure that make_clickable is run before wptexturize

Reported by: orioneweb Owned by: boonebgorges
Milestone: 1.5 Priority: major
Severity: Version:
Component: Activity Keywords: close
Cc:

Description

latest wordpress, latest buddypress.

In pages like http://elosnetwork.it/members/USERNAME/ if the user posts something that ends with a link there's a " attached to the link so the link is broken.
For example user posted
abcdefg http://example.com
And buddypress shows (without > and <)
"abcdefg a href=http://example.com" /a with the trailing ", breaking the link
the " should not go in the link but be separated from it

Also, if the user posts www.example.com instead of http://www.example.com the link doesn't seem to be clickable.

Attachments (1)

_bug.jpg (58.9 KB) - added by orioneweb 4 years ago.
screenshot example

Download all attachments as: .zip

Change History (8)

orioneweb4 years ago

screenshot example

comment:1 in reply to: ↑ description orioneweb4 years ago

I made sure that this bug also happens in the default buddypress theme on a clean latest wpmu and latest buddypress install

Replying to orioneweb:

latest wordpress, latest buddypress.

In pages like http://elosnetwork.it/members/USERNAME/ if the user posts something that ends with a link there's a " attached to the link so the link is broken.
For example user posted
abcdefg http://example.com
And buddypress shows (without > and <)
"abcdefg a href=http://example.com" /a with the trailing ", breaking the link
the " should not go in the link but be separated from it

Also, if the user posts www.example.com instead of http://www.example.com the link doesn't seem to be clickable.

comment:2 DJPaul3 years ago

  • Priority changed from normal to major

Confirmed in trunk. Any link with a trailing " mangles the <a> link in the header section of a member's profile. The link displays fine in the activity stream.

comment:3 boonebgorges3 years ago

  • Keywords close added

I ran a couple of tests and the problem boils down to the make_clickable filter, as applied to bp_get_activity_latest_update_excerpt and bp_get_activity_latest_update in bp-activity-filters.php.

Essentially, I think this is a WordPress problem. The regex in make_clickable and its callbacks doesn't know what to do with a quotation mark at the end of a URL. I tested this in a normal blog post (making sure to add_filter( 'the_content', 'make_clickable' ); )

I vote for marking this ticket invalid, with a suggestion that we send it upstream to WordPress. See #WP10990 #WP5081 for possibly related issues.

Last edited 3 years ago by boonebgorges (previous) (diff)

comment:4 boonebgorges3 years ago

  • Resolution set to invalid
  • Status changed from new to closed

comment:5 boonebgorges3 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened
  • Summary changed from posting links at the end of status updates breaks them in member page to Make sure that make_clickable is run before wptexturize

Reopening this ticket because I've been straightened out a bit on WP trac. The root cause of the problem is not make_clickable() itself, but the fact that BP is not making sure to run it before wptexturize, which is responsible for converting quotes into HTML entities. (WP sets its uses of make_clickable to priority 9.) I've run a preliminary test or two and this seems to fix the problem. I'll sweep through the rest of the components and make sure that it doesn't cause any other problems.

comment:6 boonebgorges3 years ago

  • Owner set to boonebgorges
  • Status changed from reopened to accepted

comment:7 boonebgorges3 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [4200]) Ensures that make_clickable is run before wptexturize in content filters. Fixes #2443

Note: See TracTickets for help on using tickets.