Changeset 56873 for branches/5.1/src/wp-admin/includes/ajax-actions.php
- Timestamp:
- 10/12/2023 03:02:41 PM (2 years ago)
- Location:
- branches/5.1
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/wp-admin/includes/ajax-actions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/5.1
- Property svn:mergeinfo changed
/trunk merged: 56833-56836,56838
- Property svn:mergeinfo changed
-
branches/5.1/src/wp-admin/includes/ajax-actions.php
r55790 r56873 3497 3497 $shortcode = wp_unslash( $_POST['shortcode'] ); 3498 3498 3499 // Only process previews for media related shortcodes: 3500 $found_shortcodes = get_shortcode_tags_in_content( $shortcode ); 3501 $media_shortcodes = array( 3502 'audio', 3503 'embed', 3504 'playlist', 3505 'video', 3506 'gallery', 3507 ); 3508 3509 $other_shortcodes = array_diff( $found_shortcodes, $media_shortcodes ); 3510 3511 if ( ! empty( $other_shortcodes ) ) { 3512 wp_send_json_error(); 3513 } 3514 3499 3515 if ( ! empty( $_POST['post_ID'] ) ) { 3500 3516 $post = get_post( (int) $_POST['post_ID'] ); … … 3503 3519 // the embed shortcode requires a post 3504 3520 if ( ! $post || ! current_user_can( 'edit_post', $post->ID ) ) { 3505 if ( 'embed' === $shortcode) {3521 if ( in_array( 'embed', $found_shortcodes, true ) ) { 3506 3522 wp_send_json_error(); 3507 3523 }
Note: See TracChangeset
for help on using the changeset viewer.