Changeset 56859 for branches/4.6/src/wp-admin/includes/ajax-actions.php
- Timestamp:
- 10/12/2023 02:43:19 PM (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.6/src/wp-admin/includes/ajax-actions.php
r55783 r56859 3053 3053 $shortcode = wp_unslash( $_POST['shortcode'] ); 3054 3054 3055 // Only process previews for media related shortcodes: 3056 $found_shortcodes = get_shortcode_tags_in_content( $shortcode ); 3057 $media_shortcodes = array( 3058 'audio', 3059 'embed', 3060 'playlist', 3061 'video', 3062 'gallery', 3063 ); 3064 3065 $other_shortcodes = array_diff( $found_shortcodes, $media_shortcodes ); 3066 3067 if ( ! empty( $other_shortcodes ) ) { 3068 wp_send_json_error(); 3069 } 3070 3055 3071 if ( ! empty( $_POST['post_ID'] ) ) { 3056 3072 $post = get_post( (int) $_POST['post_ID'] ); … … 3059 3075 // the embed shortcode requires a post 3060 3076 if ( ! $post || ! current_user_can( 'edit_post', $post->ID ) ) { 3061 if ( 'embed' === $shortcode) {3077 if ( in_array( 'embed', $found_shortcodes, true ) ) { 3062 3078 wp_send_json_error(); 3063 3079 }
Note: See TracChangeset
for help on using the changeset viewer.