diff --git a/wp-includes/class-oembed.php b/wp-includes/class-oembed.php index b60a4f4794..51a2a899a8 100644 --- a/wp-includes/class-oembed.php +++ b/wp-includes/class-oembed.php @@ -309,6 +309,9 @@ class WP_oEmbed { */ public function discover( $url ) { $providers = array(); + $args = array( + 'limit_response_size' => 153600, // 150 KB + ); /** * Filter oEmbed remote get arguments. @@ -320,7 +323,7 @@ class WP_oEmbed { * @param array $args oEmbed remote get arguments. * @param string $url URL to be inspected. */ - $args = apply_filters( 'oembed_remote_get_args', array(), $url ); + $args = apply_filters( 'oembed_remote_get_args', $args, $url ); // Fetch URL content $request = wp_safe_remote_get( $url, $args ); @@ -342,7 +345,9 @@ class WP_oEmbed { ) ); // Strip - $html = substr( $html, 0, stripos( $html, '' ) ); + if ( $html_head_end = stripos( $html, '' ) ) { + $html = substr( $html, 0, $html_head_end ); + } // Do a quick check $tagfound = false; diff --git a/wp-includes/version.php b/wp-includes/version.php index 89daf015c9..f812304751 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-beta2-36879'; +$wp_version = '4.5-beta2-36880'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.