Make WordPress Core


Ignore:
Timestamp:
10/08/2015 11:21:49 PM (9 years ago)
Author:
DrewAPicture
Message:

Embeds: Rename the $return parameter in wp_filter_oembed_result() to $result to provide better context on what is being filtered.

See #32522.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/embed-functions.php

    r34972 r34974  
    680680 * Filters the given oEmbed HTML.
    681681 *
    682  * If the $url isn't on the trusted providers list,
     682 * If the `$url` isn't on the trusted providers list,
    683683 * we need to filter the HTML heavily for security.
    684684 *
     
    687687 * @since 4.4.0
    688688 *
    689  * @param string $return The returned oEmbed HTML.
     689 * @param string $result The oEmbed HTML result.
    690690 * @param object $data   A data object result from an oEmbed provider.
    691691 * @param string $url    The URL of the content to be embedded.
    692692 * @return string The filtered and sanitized oEmbed result.
    693693 */
    694 function wp_filter_oembed_result( $return, $data, $url ) {
    695     if ( false === $return || ! in_array( $data->type, array( 'rich', 'video' ) ) ) {
    696         return $return;
     694function wp_filter_oembed_result( $result, $data, $url ) {
     695    if ( false === $result || ! in_array( $data->type, array( 'rich', 'video' ) ) ) {
     696        return $result;
    697697    }
    698698
     
    702702    // Don't modify the HTML for trusted providers.
    703703    if ( false !== $wp_oembed->get_provider( $url, array( 'discover' => false ) ) ) {
    704         return $return;
     704        return $result;
    705705    }
    706706
     
    719719    );
    720720
    721     $html = wp_kses( $return, $allowed_html );
     721    $html = wp_kses( $result, $allowed_html );
    722722    preg_match( '|^.*(<iframe.*?></iframe>).*$|m', $html, $iframes );
    723723
Note: See TracChangeset for help on using the changeset viewer.