Changeset 42343 for trunk/src/wp-admin/media-upload.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/media-upload.php
r38307 r42343 10 10 */ 11 11 12 if ( ! isset( $_GET['inline'] ) ) 13 define( 'IFRAME_REQUEST' , true ); 12 if ( ! isset( $_GET['inline'] ) ) { 13 define( 'IFRAME_REQUEST', true ); 14 } 14 15 15 16 /** Load WordPress Administration Bootstrap */ … … 20 21 } 21 22 22 wp_enqueue_script( 'plupload-handlers');23 wp_enqueue_script( 'image-edit');24 wp_enqueue_script( 'set-post-thumbnail' );25 wp_enqueue_style( 'imgareaselect');23 wp_enqueue_script( 'plupload-handlers' ); 24 wp_enqueue_script( 'image-edit' ); 25 wp_enqueue_script( 'set-post-thumbnail' ); 26 wp_enqueue_style( 'imgareaselect' ); 26 27 wp_enqueue_script( 'media-gallery' ); 27 28 28 @header( 'Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));29 @header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); 29 30 30 31 // IDs should be integers 31 $ID = isset($ID) ? (int) $ID : 0;32 $post_id = isset( $post_id)? (int) $post_id : 0;32 $ID = isset( $ID ) ? (int) $ID : 0; 33 $post_id = isset( $post_id ) ? (int) $post_id : 0; 33 34 34 35 // Require an ID for the edit screen. 35 if ( isset( $action ) && $action == 'edit' && ! $ID ) {36 if ( isset( $action ) && $action == 'edit' && ! $ID ) { 36 37 wp_die( 37 38 '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . … … 41 42 } 42 43 43 if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post' 44 if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post', $_REQUEST['post_id'] ) ) { 44 45 wp_die( 45 46 '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . … … 50 51 51 52 // Upload type: image, video, file, ..? 52 if ( isset( $_GET['type']) ) {53 $type = strval( $_GET['type']);53 if ( isset( $_GET['type'] ) ) { 54 $type = strval( $_GET['type'] ); 54 55 } else { 55 56 /** … … 65 66 66 67 // Tab: gallery, library, or type-specific. 67 if ( isset( $_GET['tab']) ) {68 $tab = strval( $_GET['tab']);68 if ( isset( $_GET['tab'] ) ) { 69 $tab = strval( $_GET['tab'] ); 69 70 } else { 70 71 /** … … 81 82 82 83 // Let the action code decide how to handle the request. 83 if ( $tab == 'type' || $tab == 'type_url' || ! array_key_exists( $tab 84 if ( $tab == 'type' || $tab == 'type_url' || ! array_key_exists( $tab, media_upload_tabs() ) ) { 84 85 /** 85 86 * Fires inside specific upload-type views in the legacy (pre-3.5.0)
Note: See TracChangeset
for help on using the changeset viewer.