Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (7 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/media-upload.php

    r38307 r42343  
    1010 */
    1111
    12 if ( ! isset( $_GET['inline'] ) )
    13     define( 'IFRAME_REQUEST' , true );
     12if ( ! isset( $_GET['inline'] ) ) {
     13    define( 'IFRAME_REQUEST', true );
     14}
    1415
    1516/** Load WordPress Administration Bootstrap */
     
    2021}
    2122
    22 wp_enqueue_script('plupload-handlers');
    23 wp_enqueue_script('image-edit');
    24 wp_enqueue_script('set-post-thumbnail' );
    25 wp_enqueue_style('imgareaselect');
     23wp_enqueue_script( 'plupload-handlers' );
     24wp_enqueue_script( 'image-edit' );
     25wp_enqueue_script( 'set-post-thumbnail' );
     26wp_enqueue_style( 'imgareaselect' );
    2627wp_enqueue_script( 'media-gallery' );
    2728
    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' ) );
    2930
    3031// 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;
    3334
    3435// Require an ID for the edit screen.
    35 if ( isset( $action ) && $action == 'edit' && !$ID ) {
     36if ( isset( $action ) && $action == 'edit' && ! $ID ) {
    3637    wp_die(
    3738        '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     
    4142}
    4243
    43 if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post' , $_REQUEST['post_id'] ) ) {
     44if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post', $_REQUEST['post_id'] ) ) {
    4445    wp_die(
    4546        '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     
    5051
    5152// Upload type: image, video, file, ..?
    52 if ( isset($_GET['type']) ) {
    53     $type = strval($_GET['type']);
     53if ( isset( $_GET['type'] ) ) {
     54    $type = strval( $_GET['type'] );
    5455} else {
    5556    /**
     
    6566
    6667// Tab: gallery, library, or type-specific.
    67 if ( isset($_GET['tab']) ) {
    68     $tab = strval($_GET['tab']);
     68if ( isset( $_GET['tab'] ) ) {
     69    $tab = strval( $_GET['tab'] );
    6970} else {
    7071    /**
     
    8182
    8283// Let the action code decide how to handle the request.
    83 if ( $tab == 'type' || $tab == 'type_url' || ! array_key_exists( $tab , media_upload_tabs() ) ) {
     84if ( $tab == 'type' || $tab == 'type_url' || ! array_key_exists( $tab, media_upload_tabs() ) ) {
    8485    /**
    8586     * Fires inside specific upload-type views in the legacy (pre-3.5.0)
Note: See TracChangeset for help on using the changeset viewer.