[buddypress-trac] [BuddyPress Trac] #5626: Ending double quote of activity note get mixed with anchor link in Members view

buddypress-trac noreply at wordpress.org
Thu May 8 17:34:34 UTC 2014

#5626: Ending double quote of activity note get mixed with anchor link in Members
 Reporter:  nirgalo       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  2.1
Component:  Members       |     Version:  2.0
 Severity:  normal        |  Resolution:
 Keywords:                |
Changes (by boonebgorges):

 * keywords:  reporter-feedback =>
 * milestone:  Awaiting Review => 2.1


 OK. After some digging, it looks like the problem is as follows.
 `make_clickable` is applied to the content sent through the
 `bp_get_activity_latest_update_excerpt' filter. But the value that we're
 currently passing to this filter is the excerpt sprintf()ed into the
 wrapper. So, for the following update

 Check out this site: http://buddypress.org

 the string that is being made clickable is

 - "Check out this site: http://buddypress.org "

 The extra space between `.org` and `"` in BP's source code tells
 `make_clickable()` not to include `"` in the URL. But in the French
 translation of the wrapper string:

 msgid "- "%s ""
 msgstr "- «%s»"

 the extra space is not present. So `make_clickable()` thinks that the
 trailing guillemet is part of the URL.

 I wonder if this extra space is intentional. Looking back on the original
 ticket #3505, I see that it was added in between patch 01 and 02. r-a-y,
 maybe you can shed some light on this :)

 In any case, it's a bug in BP that we're doing it this way. For 100%
 backward compatibility, my initial thought was that we should create a new
 filter for the excerpt alone, and preserve the existing `_excerpt` filter
 on the sprintf()ed string. But I now see that we are using the same filter
 name in the activity component on a standalone excerpt:
 activity-template.php#L2527 So it seems like we should probably not add a
 second filter, and just fix the placement of the first one so that it's
 filtering only the excerpt. (Fixing two bugs with one stone!)

 In my fix, I am also going to remove the extraneous space from the wrapper
 string (`'- "%s"'` instead of `'"%s "'`). nirgalo,
 this will break your existing translation, so you may want to update your
 .po/.mo file manually if you want to be able to test the changes before BP
 2.1 comes out in a few months.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5626#comment:15>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list