Make WordPress Core

Changeset 29546


Ignore:
Timestamp:
08/19/2014 11:22:47 PM (12 years ago)
Author:
azaozz
Message:

TinyMCE wpView: show an error when no items are found while parsing a audio/video/playlist shortcode. Props avryl, fixes #29114.

File:
1 edited

Legend:

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

    r29490 r29546  
    27162716    }
    27172717
     2718    if ( empty( $_POST['shortcode'] ) || ! current_user_can( 'edit_post', $post->ID ) ) {
     2719        wp_send_json_error();
     2720    }
     2721
    27182722    setup_postdata( $post );
     2723    $shortcode = do_shortcode( wp_unslash( $_REQUEST['shortcode'] ) );
     2724
     2725    if ( empty( $shortcode ) ) {
     2726        wp_send_json_error( array( 'statusText' => __( 'No items found.' ) ) );
     2727    }
    27192728
    27202729    ob_start();
     
    27252734    }
    27262735
    2727     echo do_shortcode( wp_unslash( $_REQUEST['shortcode'] ) );
     2736    echo $shortcode;
    27282737
    27292738    if ( ! empty( $wp_scripts ) ) {
Note: See TracChangeset for help on using the changeset viewer.