Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/06/2011 04:24:46 PM (15 years ago)
Author:
djpaul
Message:

Tweak BP_Embed implementation; fix caching and PHP warning. Fixes #3429, props r-a-y

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-classes.php

    r4934 r4937  
    11691169                ksort( $this->handlers );
    11701170                foreach ( $this->handlers as $priority => $handlers ) {
    1171                         foreach ( $handlers as $id => $handler ) {
     1171                        foreach ( $handlers as $hid => $handler ) {
    11721172                                if ( preg_match( $handler['regex'], $url, $matches ) && is_callable( $handler['callback'] ) ) {
    11731173                                        if ( false !== $return = call_user_func( $handler['callback'], $matches, $attr, $url, $rawattr ) )
    … …  
    11781178
    11791179                // Get object ID
    1180                 $id = apply_filters( 'embed_post_id', $id );
     1180                $id = apply_filters( 'embed_post_id', 0 );
    11811181
    11821182                // Is oEmbed discovery on?
    … …  
    12201220         */
    12211221        function parse_oembed( $id, $url, $attr, $rawattr ) {
     1222                $id = intval( $id );
     1223
    12221224                if ( $id ) {
    12231225                        // Setup the cachekey
    … …  
    12301232                        // Grab cache and return it if available
    12311233                        if ( !empty( $cache ) ) {
    1232                                 return apply_filters( 'embed_oembed_html', $cache, $url, $attr, $rawattr );
     1234                                return apply_filters( 'bp_embed_oembed_html', $cache, $url, $attr, $rawattr );
    12331235
    12341236                        // If no cache, ping the oEmbed provider and cache the result
Note: See TracChangeset for help on using the changeset viewer.