mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-04 17:20:07 +00:00
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. Props kraftbj. See #36767. git-svn-id: https://develop.svn.wordpress.org/trunk@37729 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user