Make WordPress Core


Ignore:
Timestamp:
04/21/2015 10:40:23 PM (11 years ago)
Author:
azaozz
Message:

Revert editing of video embed parameters in the media modal, [31620] and [31626] for now. Plan on revisiting in 4.3.
Props iseulde. Fixes #31139, fixes #32006.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r32079 r32258  
    27152715
    27162716    $shortcode = wp_unslash( $_POST['shortcode'] );
    2717 
    2718     preg_match( '/' . get_shortcode_regex() . '/s', $shortcode, $matches );
    2719     $atts = shortcode_parse_atts( $matches[3] );
    2720     if ( ! empty( $matches[5] ) ) {
    2721         $url = $matches[5];
    2722     } elseif ( ! empty( $atts['src'] ) ) {
    2723         $url = $atts['src'];
    2724     }
     2717    $url = str_replace( '[embed]', '', str_replace( '[/embed]', '', $shortcode ) );
    27252718
    27262719    $parsed = false;
     
    27292722    $wp_embed->return_false_on_fail = true;
    27302723
    2731     if ( is_ssl() && 0 === strpos( $url, 'http://' ) ) {
     2724    if ( is_ssl() && preg_match( '%^\\[embed[^\\]]*\\]http://%i', $shortcode ) ) {
    27322725        // Admin is ssl and the user pasted non-ssl URL.
    27332726        // Check if the provider supports ssl embeds and use that for the preview.
     
    27822775
    27832776    wp_send_json_success( array(
    2784         'body' => $parsed,
    2785         'attr' => $wp_embed->last_attr
     2777        'body' => $parsed
    27862778    ) );
    27872779}
Note: See TracChangeset for help on using the changeset viewer.