diff --git src/wp-admin/includes/ajax-actions.php src/wp-admin/includes/ajax-actions.php
index 5c53f6805c..c523411efb 100644
|
|
function wp_ajax_query_themes() { |
3005 | 3005 | function wp_ajax_parse_embed() { |
3006 | 3006 | global $post, $wp_embed; |
3007 | 3007 | |
3008 | | if ( ! $post = get_post( (int) $_POST['post_ID'] ) ) { |
| 3008 | if ( empty( $_POST['shortcode'] ) ) { |
3009 | 3009 | wp_send_json_error(); |
3010 | 3010 | } |
3011 | | |
3012 | | if ( empty( $_POST['shortcode'] ) || ! current_user_can( 'edit_post', $post->ID ) ) { |
| 3011 | $post_id = isset( $_POST[ 'post_ID' ] ) ? intval( $_POST[ 'post_ID' ] ) : 0; |
| 3012 | if ( $post_id > 0 ) { |
| 3013 | $post = get_post( $post_id ); |
| 3014 | if ( ! $post || ! current_user_can( 'edit_post', $post->ID ) ) { |
| 3015 | wp_send_json_error(); |
| 3016 | } |
| 3017 | setup_postdata( $post ); |
| 3018 | } elseif ( ! current_user_can( 'edit_posts' ) ) { // See WP_oEmbed_Controller::get_proxy_item_permissions_check(). |
3013 | 3019 | wp_send_json_error(); |
3014 | 3020 | } |
3015 | 3021 | |
… |
… |
function wp_ajax_parse_embed() { |
3026 | 3032 | } |
3027 | 3033 | |
3028 | 3034 | $parsed = false; |
3029 | | setup_postdata( $post ); |
3030 | | |
3031 | 3035 | $wp_embed->return_false_on_fail = true; |
3032 | 3036 | |
3033 | 3037 | if ( is_ssl() && 0 === strpos( $url, 'http://' ) ) { |