[buddypress-trac] [BuddyPress Trac] #7104: oembed activity review

buddypress-trac noreply at wordpress.org
Tue May 31 18:27:56 UTC 2016


#7104: oembed activity review
--------------------------+------------------
 Reporter:  DJPaul        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  2.6
Component:  API           |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------

Comment (by r-a-y):

 >  throws an exception -- we do not use exceptions anywhere in BuddyPress,
 and they are infrequent in WordPress core (for good or bad).

 I think exceptions are good, but I understand the concerns of sticking
 with what WordPress is doing.

 I'm fine with whatever you decide here.

 ----

 > bp_activity_setup_oembed() we could just move these filters into
 acitivity-filters.php

 Will make the change.

 ----

 > Also in bp_activity_setup_oembed(), we should use version_compare() to
 check the WordPress function.

 Will make the change.  Is there a legitimate use for
 `bp_get_major_wp_version()`?

 ----

 > bp_activity_embed_excerpt_onclick_location_filter() -- the regular
 expression is too brittle.

 Good catch.  I guess a dev that is filtering the embed excerpt could
 inject link attributes before the onclick filter is run.

 Anyway, this should work:

 {{{#!php
 function bp_activity_embed_excerpt_onclick_location_filter( $text ) {
         return preg_replace_callback( '/<a\s+[^>]*href=\"([^\"]*)\"/iU',
 'bp_activity_embed_excerpt_onclick_location_filter_callback', $text );
 }
 }}}

 ----

 > bp_activity_embed_has_activity() the (int) $activity_id === (int)
 $activity->id bit

 I'll commit some stuff from #6977 to fix this.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7104#comment:4>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list