Embeds: Enforce a valid post ID when embedding a post from the current site.
Otherwise `wp_filter_pre_oembed_result()` could erroneously return the HTML of the current post instead of the intended result. Merge of [37729] to the 4.5 branch. Props kraftbj. See #36767. Built from https://develop.svn.wordpress.org/branches/4.5@37732 git-svn-id: http://core.svn.wordpress.org/branches/4.5@37697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c3a292dc76
commit
e05facfc58
|
@ -1100,6 +1100,10 @@ function wp_filter_pre_oembed_result( $result, $url, $args ) {
|
|||
/** This filter is documented in wp-includes/class-wp-oembed-controller.php */
|
||||
$post_id = apply_filters( 'oembed_request_post_id', $post_id, $url );
|
||||
|
||||
if ( ! $post_id ) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
$width = isset( $args['width'] ) ? $args['width'] : 0;
|
||||
|
||||
$data = get_oembed_response_data( $post_id, $width );
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.5.3-alpha-37725';
|
||||
$wp_version = '4.5.3-alpha-37732';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue