Changeset 49108 for trunk/src/wp-admin/includes/media.php
- Timestamp:
- 10/08/2020 09:13:57 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/media.php
r49064 r49108 50 50 } 51 51 52 $post_id = intval( $_REQUEST['post_id'] );52 $post_id = (int) $_REQUEST['post_id']; 53 53 54 54 if ( $post_id ) { 55 $attachments = intval( $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent = %d", $post_id )) );55 $attachments = (int) $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent = %d", $post_id ) ); 56 56 } 57 57 … … 139 139 $rel = ' rel="' . esc_attr( $rel ) . '"'; 140 140 } else { 141 $rel = ' rel="attachment wp-att-' . intval( $id ). '"';141 $rel = ' rel="attachment wp-att-' . (int) $id . '"'; 142 142 } 143 143 } else { … … 1550 1550 1551 1551 $thumb_url = false; 1552 $attachment_id = intval( $attachment_id );1552 $attachment_id = (int) $attachment_id; 1553 1553 1554 1554 if ( $attachment_id ) { … … 2036 2036 */ 2037 2037 function media_upload_header() { 2038 $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ): 0;2038 $post_id = isset( $_REQUEST['post_id'] ) ? (int) $_REQUEST['post_id'] : 0; 2039 2039 2040 2040 echo '<script type="text/javascript">post_id = ' . $post_id . ';</script>'; … … 2072 2072 2073 2073 $upload_action_url = admin_url( 'async-upload.php' ); 2074 $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ): 0;2074 $post_id = isset( $_REQUEST['post_id'] ) ? (int) $_REQUEST['post_id'] : 0; 2075 2075 $_type = isset( $type ) ? $type : ''; 2076 2076 $_tab = isset( $tab ) ? $tab : ''; … … 2282 2282 media_upload_header(); 2283 2283 2284 $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ): 0;2284 $post_id = isset( $_REQUEST['post_id'] ) ? (int) $_REQUEST['post_id'] : 0; 2285 2285 2286 2286 $form_action_url = admin_url( "media-upload.php?type=$type&tab=type&post_id=$post_id" ); … … 2359 2359 media_upload_header(); 2360 2360 2361 $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ): 0;2361 $post_id = isset( $_REQUEST['post_id'] ) ? (int) $_REQUEST['post_id'] : 0; 2362 2362 2363 2363 $form_action_url = admin_url( "media-upload.php?type=$type&tab=type&post_id=$post_id" ); … … 2507 2507 media_upload_header(); 2508 2508 2509 $post_id = intval( $_REQUEST['post_id'] );2509 $post_id = (int) $_REQUEST['post_id']; 2510 2510 $form_action_url = admin_url( "media-upload.php?type=$type&tab=gallery&post_id=$post_id" ); 2511 2511 /** This filter is documented in wp-admin/includes/media.php */ … … 2670 2670 media_upload_header(); 2671 2671 2672 $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ): 0;2672 $post_id = isset( $_REQUEST['post_id'] ) ? (int) $_REQUEST['post_id'] : 0; 2673 2673 2674 2674 $form_action_url = admin_url( "media-upload.php?type=$type&tab=library&post_id=$post_id" ); … … 2683 2683 $q = $_GET; 2684 2684 $q['posts_per_page'] = 10; 2685 $q['paged'] = isset( $q['paged'] ) ? intval( $q['paged'] ): 0;2685 $q['paged'] = isset( $q['paged'] ) ? (int) $q['paged'] : 0; 2686 2686 if ( $q['paged'] < 1 ) { 2687 2687 $q['paged'] = 1; … … 2985 2985 $post = get_post(); 2986 2986 if ( $post ) { 2987 $browser_uploader .= '&post_id=' . intval( $post->ID );2987 $browser_uploader .= '&post_id=' . (int) $post->ID; 2988 2988 } elseif ( ! empty( $GLOBALS['post_ID'] ) ) { 2989 $browser_uploader .= '&post_id=' . intval( $GLOBALS['post_ID'] );2989 $browser_uploader .= '&post_id=' . (int) $GLOBALS['post_ID']; 2990 2990 } 2991 2991 … … 3079 3079 3080 3080 $thumb_url = false; 3081 $attachment_id = intval( $post->ID );3081 $attachment_id = (int) $post->ID; 3082 3082 3083 3083 if ( $attachment_id ) {
Note: See TracChangeset
for help on using the changeset viewer.