From 9cbb68a4aff430bcb702182dec0c3268b6563427 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Thu, 8 Oct 2015 23:22:24 +0000 Subject: [PATCH] Embeds: Rename the `$return` parameter in `wp_filter_oembed_result()` to `$result` to provide better context on what is being filtered. See #32522. Built from https://develop.svn.wordpress.org/trunk@34974 git-svn-id: http://core.svn.wordpress.org/trunk@34939 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/embed-functions.php | 14 +++++++------- wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/wp-includes/embed-functions.php b/wp-includes/embed-functions.php index 1db32f0265..8400f01b66 100644 --- a/wp-includes/embed-functions.php +++ b/wp-includes/embed-functions.php @@ -679,21 +679,21 @@ function _oembed_create_xml( $data, $node = null ) { /** * Filters the given oEmbed HTML. * - * If the $url isn't on the trusted providers list, + * If the `$url` isn't on the trusted providers list, * we need to filter the HTML heavily for security. * * Only filters 'rich' and 'html' response types. * * @since 4.4.0 * - * @param string $return The returned oEmbed HTML. + * @param string $result The oEmbed HTML result. * @param object $data A data object result from an oEmbed provider. * @param string $url The URL of the content to be embedded. * @return string The filtered and sanitized oEmbed result. */ -function wp_filter_oembed_result( $return, $data, $url ) { - if ( false === $return || ! in_array( $data->type, array( 'rich', 'video' ) ) ) { - return $return; +function wp_filter_oembed_result( $result, $data, $url ) { + if ( false === $result || ! in_array( $data->type, array( 'rich', 'video' ) ) ) { + return $result; } require_once( ABSPATH . WPINC . '/class-oembed.php' ); @@ -701,7 +701,7 @@ function wp_filter_oembed_result( $return, $data, $url ) { // Don't modify the HTML for trusted providers. if ( false !== $wp_oembed->get_provider( $url, array( 'discover' => false ) ) ) { - return $return; + return $result; } $allowed_html = array( @@ -718,7 +718,7 @@ function wp_filter_oembed_result( $return, $data, $url ) { ), ); - $html = wp_kses( $return, $allowed_html ); + $html = wp_kses( $result, $allowed_html ); preg_match( '|^.*().*$|m', $html, $iframes ); if ( empty( $iframes ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index c75005c9c6..ba87b4bc1b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34973'; +$wp_version = '4.4-alpha-34974'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.