Make WordPress Core

Changeset 45583


Ignore:
Timestamp:
07/01/2019 12:50:14 PM (7 years ago)
Author:
pento
Message:

Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-admin.

See #47632.

Location:
trunk/src/wp-admin
Files:
74 edited

Legend:

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

    r44331 r45583  
    4040
    4141// just fetch the detail form for that attachment
    42 if ( isset( $_REQUEST['attachment_id'] ) && ( $id = intval( $_REQUEST['attachment_id'] ) ) && $_REQUEST['fetch'] ) {
     42if ( isset( $_REQUEST['attachment_id'] ) && intval( $_REQUEST['attachment_id'] ) && $_REQUEST['fetch'] ) {
     43        $id   = intval( $_REQUEST['attachment_id'] );
    4344        $post = get_post( $id );
    4445        if ( 'attachment' != $post->post_type ) {
    … …  
    5152        switch ( $_REQUEST['fetch'] ) {
    5253                case 3:
    53                         if ( $thumb_url = wp_get_attachment_image_src( $id, 'thumbnail', true ) ) {
     54                        $thumb_url = wp_get_attachment_image_src( $id, 'thumbnail', true );
     55                        if ( $thumb_url ) {
    5456                                echo '<img class="pinkynail" src="' . esc_url( $thumb_url[0] ) . '" alt="" />';
    5557                        }
  • trunk/src/wp-admin/comment.php

    r45140 r45583  
    6363                $comment_id = absint( $_GET['c'] );
    6464
    65                 if ( ! $comment = get_comment( $comment_id ) ) {
     65                $comment = get_comment( $comment_id );
     66                if ( ! $comment ) {
    6667                        comment_footer_die( __( 'Invalid comment ID.' ) . sprintf( ' <a href="%s">' . __( 'Go back' ) . '</a>.', 'javascript:history.go(-1)' ) );
    6768                }
    … …  
    8990                $comment_id = absint( $_GET['c'] );
    9091
    91                 if ( ! $comment = get_comment( $comment_id ) ) {
     92                $comment = get_comment( $comment_id );
     93                if ( ! $comment ) {
    9294                        wp_redirect( admin_url( 'edit-comments.php?error=1' ) );
    9395                        die();
    … …  
    261263                $noredir = isset( $_REQUEST['noredir'] );
    262264
    263                 if ( ! $comment = get_comment( $comment_id ) ) {
     265                $comment = get_comment( $comment_id );
     266                if ( ! $comment ) {
    264267                        comment_footer_die( __( 'Invalid comment ID.' ) . sprintf( ' <a href="%s">' . __( 'Go back' ) . '</a>.', 'edit-comments.php' ) );
    265268                }
  • trunk/src/wp-admin/custom-background.php

    r45411 r45583  
    257257                } else {
    258258                        $background_styles = '';
    259                         if ( $bgcolor = get_background_color() ) {
     259                        $bgcolor           = get_background_color();
     260                        if ( $bgcolor ) {
    260261                                $background_styles .= 'background-color: #' . $bgcolor . ';';
    261262                        }
  • trunk/src/wp-admin/edit-comments.php

    r45140 r45583  
    4040        }
    4141
    42         $approved = $unapproved = $spammed = $unspammed = $trashed = $untrashed = $deleted = 0;
     42        $approved   = 0;
     43        $unapproved = 0;
     44        $spammed    = 0;
     45        $unspammed  = 0;
     46        $trashed    = 0;
     47        $untrashed  = 0;
     48        $deleted    = 0;
    4349
    4450        $redirect_to = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'spammed', 'unspammed', 'approved', 'unapproved', 'ids' ), wp_get_referer() );
    … …  
    308314                }
    309315
    310                 if ( $same > 0 && $comment = get_comment( $same ) ) {
    311                         switch ( $comment->comment_approved ) {
    312                                 case '1':
    313                                         $messages[] = __( 'This comment is already approved.' ) . ' <a href="' . esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ) . '">' . __( 'Edit comment' ) . '</a>';
    314                                         break;
    315                                 case 'trash':
    316                                         $messages[] = __( 'This comment is already in the Trash.' ) . ' <a href="' . esc_url( admin_url( 'edit-comments.php?comment_status=trash' ) ) . '"> ' . __( 'View Trash' ) . '</a>';
    317                                         break;
    318                                 case 'spam':
    319                                         $messages[] = __( 'This comment is already marked as spam.' ) . ' <a href="' . esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ) . '">' . __( 'Edit comment' ) . '</a>';
    320                                         break;
     316                if ( $same > 0 ) {
     317                        $comment = get_comment( $same );
     318                        if ( $comment ) {
     319                                switch ( $comment->comment_approved ) {
     320                                        case '1':
     321                                                $messages[] = __( 'This comment is already approved.' ) . ' <a href="' . esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ) . '">' . __( 'Edit comment' ) . '</a>';
     322                                                break;
     323                                        case 'trash':
     324                                                $messages[] = __( 'This comment is already in the Trash.' ) . ' <a href="' . esc_url( admin_url( 'edit-comments.php?comment_status=trash' ) ) . '"> ' . __( 'View Trash' ) . '</a>';
     325                                                break;
     326                                        case 'spam':
     327                                                $messages[] = __( 'This comment is already marked as spam.' ) . ' <a href="' . esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ) . '">' . __( 'Edit comment' ) . '</a>';
     328                                                break;
     329                                }
    321330                        }
    322331                }
  • trunk/src/wp-admin/edit-form-advanced.php

    r45437 r45583  
    4141
    4242wp_enqueue_script( 'post' );
    43 $_wp_editor_expand = $_content_editor_dfw = false;
     43
     44$_wp_editor_expand   = false;
     45$_content_editor_dfw = false;
    4446
    4547/**
    … …  
    107109$messages = array();
    108110
    109 $preview_post_link_html = $scheduled_post_link_html = $view_post_link_html = '';
    110 $preview_page_link_html = $scheduled_page_link_html = $view_page_link_html = '';
     111$preview_post_link_html   = '';
     112$scheduled_post_link_html = '';
     113$view_post_link_html      = '';
     114
     115$preview_page_link_html   = '';
     116$scheduled_page_link_html = '';
     117$view_page_link_html      = '';
    111118
    112119$preview_url = get_preview_post_link( $post );
    … …  
    577584        if ( 'auto-draft' != $post->post_status ) {
    578585                echo '<span id="last-edit">';
    579                 if ( $last_user = get_userdata( get_post_meta( $post_ID, '_edit_last', true ) ) ) {
     586                $last_user = get_userdata( get_post_meta( $post_ID, '_edit_last', true ) );
     587                if ( $last_user ) {
    580588                        /* translators: 1: Name of most recent post author, 2: Post edited date, 3: Post edited time */
    581589                        printf( __( 'Last edited by %1$s on %2$s at %3$s' ), esc_html( $last_user->display_name ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) );
  • trunk/src/wp-admin/edit.php

    r45140 r45583  
    104104        switch ( $doaction ) {
    105105                case 'trash':
    106                         $trashed = $locked = 0;
     106                        $trashed = 0;
     107                        $locked  = 0;
    107108
    108109                        foreach ( (array) $post_ids as $post_id ) {
  • trunk/src/wp-admin/import.php

    r45440 r45583  
    102102        <?php
    103103        foreach ( $importers as $importer_id => $data ) {
    104                 $plugin_slug         = $action = '';
     104                $plugin_slug         = '';
     105                $action              = '';
    105106                $is_plugin_installed = false;
    106107
  • trunk/src/wp-admin/includes/ajax-actions.php

    r45507 r45583  
    670670        $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
    671671
    672         if ( ! $comment = get_comment( $id ) ) {
     672        $comment = get_comment( $id );
     673        if ( ! $comment ) {
    673674                wp_die( time() );
    674675        }
    … …  
    779780
    780781        check_ajax_referer( "delete-meta_$id" );
    781         if ( ! $meta = get_metadata_by_mid( 'post', $id ) ) {
     782        $meta = get_metadata_by_mid( 'post', $id );
     783        if ( ! $meta ) {
    782784                wp_die( 1 );
    783785        }
    … …  
    907909        $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
    908910
    909         if ( ! $comment = get_comment( $id ) ) {
     911        $comment = get_comment( $id );
     912        if ( ! $comment ) {
    910913                $x = new WP_Ajax_Response(
    911914                        array(
    … …  
    10111014        $tag = wp_insert_term( $_POST['tag-name'], $taxonomy, $_POST );
    10121015
    1013         if ( ! $tag || is_wp_error( $tag ) || ( ! $tag = get_term( $tag['term_id'], $taxonomy ) ) ) {
     1016        if ( $tag && ! is_wp_error( $tag ) ) {
     1017                $tag = get_term( $tag['term_id'], $taxonomy );
     1018        }
     1019
     1020        if ( ! $tag || is_wp_error( $tag ) ) {
    10141021                $message = __( 'An error has occurred. Please reload the page and try again.' );
    10151022                if ( is_wp_error( $tag ) && $tag->get_error_message() ) {
    … …  
    14911498                                }
    14921499
    1493                                 if ( ! $mid = add_meta( $pid ) ) {
     1500                                $mid = add_meta( $pid );
     1501                                if ( ! $mid ) {
    14941502                                        wp_die( __( 'Please provide a custom field value.' ) );
    14951503                                }
    … …  
    14971505                                wp_die( 0 );
    14981506                        }
    1499                 } elseif ( ! $mid = add_meta( $pid ) ) {
    1500                         wp_die( __( 'Please provide a custom field value.' ) );
     1507                } else {
     1508                        $mid = add_meta( $pid );
     1509                        if ( ! $mid ) {
     1510                                wp_die( __( 'Please provide a custom field value.' ) );
     1511                        }
    15011512                }
    15021513
    … …  
    15201531                        wp_die( __( 'Please provide a custom field name.' ) );
    15211532                }
    1522                 if ( ! $meta = get_metadata_by_mid( 'post', $mid ) ) {
     1533                $meta = get_metadata_by_mid( 'post', $mid );
     1534                if ( ! $meta ) {
    15231535                        wp_die( 0 ); // if meta doesn't exist
    15241536                }
    … …  
    15291541                }
    15301542                if ( $meta->meta_value != $value || $meta->meta_key != $key ) {
    1531                         if ( ! $u = update_metadata_by_mid( 'post', $mid, $value, $key ) ) {
     1543                        $u = update_metadata_by_mid( 'post', $mid, $value, $key );
     1544                        if ( ! $u ) {
    15321545                                wp_die( 0 ); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems).
    15331546                        }
    … …  
    15711584                wp_die( -1 );
    15721585        }
    1573         if ( ! $user_id = edit_user() ) {
     1586        $user_id = edit_user();
     1587        if ( ! $user_id ) {
    15741588                wp_die( 0 );
    15751589        } elseif ( is_wp_error( $user_id ) ) {
    … …  
    16251639        }
    16261640
    1627         if ( ! $user = wp_get_current_user() ) {
     1641        $user = wp_get_current_user();
     1642        if ( ! $user ) {
    16281643                wp_die( -1 );
    16291644        }
    … …  
    16541669        }
    16551670
    1656         if ( ! $user = wp_get_current_user() ) {
     1671        $user = wp_get_current_user();
     1672        if ( ! $user ) {
    16571673                wp_die( -1 );
    16581674        }
    … …  
    18081824        }
    18091825
    1810         if ( ! $user = wp_get_current_user() ) {
     1826        $user = wp_get_current_user();
     1827        if ( ! $user ) {
    18111828                wp_die( -1 );
    18121829        }
    … …  
    18761893        check_ajax_referer( 'inlineeditnonce', '_inline_edit' );
    18771894
    1878         if ( ! isset( $_POST['post_ID'] ) || ! ( $post_ID = (int) $_POST['post_ID'] ) ) {
     1895        if ( ! isset( $_POST['post_ID'] ) || ! (int) $_POST['post_ID'] ) {
    18791896                wp_die();
    18801897        }
     1898
     1899        $post_ID = (int) $_POST['post_ID'];
    18811900
    18821901        if ( 'page' == $_POST['post_type'] ) {
    … …  
    18901909        }
    18911910
    1892         if ( $last = wp_check_post_lock( $post_ID ) ) {
     1911        $last = wp_check_post_lock( $post_ID );
     1912        if ( $last ) {
    18931913                $last_user      = get_userdata( $last );
    18941914                $last_user_name = $last_user ? $last_user->display_name : __( 'Someone' );
    … …  
    19922012        }
    19932013
    1994         if ( ! isset( $_POST['tax_ID'] ) || ! ( $id = (int) $_POST['tax_ID'] ) ) {
     2014        if ( ! isset( $_POST['tax_ID'] ) || ! (int) $_POST['tax_ID'] ) {
    19952015                wp_die( -1 );
    19962016        }
     2017
     2018        $id = (int) $_POST['tax_ID'];
    19972019
    19982020        if ( ! current_user_can( 'edit_term', $id ) ) {
    … …  
    22372259        }
    22382260
    2239         if ( $form = $wp_registered_widget_controls[ $widget_id ] ) {
     2261        $form = $wp_registered_widget_controls[ $widget_id ];
     2262        if ( $form ) {
    22402263                call_user_func_array( $form['callback'], $form['params'] );
    22412264        }
    … …  
    23892412        }
    23902413
    2391         if ( ! $attachment = wp_prepare_attachment_for_js( $attachment_id ) ) {
     2414        $attachment = wp_prepare_attachment_for_js( $attachment_id );
     2415        if ( ! $attachment ) {
    23922416                wp_die();
    23932417        }
    … …  
    25992623        }
    26002624
    2601         if ( $last_id = get_post_meta( $post_id, '_edit_last', true ) ) {
     2625        $last_id = get_post_meta( $post_id, '_edit_last', true );
     2626        if ( $last_id ) {
    26022627                $last_user = get_userdata( $last_id );
    26032628                /* translators: 1: display_name of last user, 2: date of last edit, 3: time of last edit. */
    … …  
    26212646        }
    26222647        $post_id = (int) $_POST['post_ID'];
    2623         if ( ! $post = get_post( $post_id ) ) {
     2648        $post    = get_post( $post_id );
     2649        if ( ! $post ) {
    26242650                wp_die( 0 );
    26252651        }
    … …  
    26852711        }
    26862712
    2687         if ( ! $id = absint( $_REQUEST['id'] ) ) {
     2713        $id = absint( $_REQUEST['id'] );
     2714        if ( ! $id ) {
    26882715                wp_send_json_error();
    26892716        }
    26902717
    2691         if ( ! $post = get_post( $id ) ) {
     2718        $post = get_post( $id );
     2719        if ( ! $post ) {
    26922720                wp_send_json_error();
    26932721        }
    … …  
    27012729        }
    27022730
    2703         if ( ! $attachment = wp_prepare_attachment_for_js( $id ) ) {
     2731        $attachment = wp_prepare_attachment_for_js( $id );
     2732        if ( ! $attachment ) {
    27042733                wp_send_json_error();
    27052734        }
    … …  
    27872816        }
    27882817
    2789         if ( ! $id = absint( $_REQUEST['id'] ) ) {
     2818        $id = absint( $_REQUEST['id'] );
     2819        if ( ! $id ) {
    27902820                wp_send_json_error();
    27912821        }
    … …  
    28702900        }
    28712901
    2872         if ( ! $id = absint( $_REQUEST['id'] ) ) {
     2902        $id = absint( $_REQUEST['id'] );
     2903        if ( ! $id ) {
    28732904                wp_send_json_error();
    28742905        }
    … …  
    29072938        }
    29082939
    2909         if ( ! $attachment = wp_prepare_attachment_for_js( $id ) ) {
     2940        $attachment = wp_prepare_attachment_for_js( $id );
     2941        if ( ! $attachment ) {
    29102942                wp_send_json_error();
    29112943        }
    … …  
    29242956        }
    29252957
    2926         if ( ! $post_id = absint( $_REQUEST['post_id'] ) ) {
     2958        $post_id = absint( $_REQUEST['post_id'] );
     2959        if ( ! $post_id ) {
    29272960                wp_send_json_error();
    29282961        }
    … …  
    29442977                        continue;
    29452978                }
    2946                 if ( ! $attachment = get_post( $attachment_id ) ) {
     2979                $attachment = get_post( $attachment_id );
     2980                if ( ! $attachment ) {
    29472981                        continue;
    29482982                }
    … …  
    29783012        $id = intval( $attachment['id'] );
    29793013
    2980         if ( ! $post = get_post( $id ) ) {
     3014        $post = get_post( $id );
     3015        if ( ! $post ) {
    29813016                wp_send_json_error();
    29823017        }
    … …  
    29883023        if ( current_user_can( 'edit_post', $id ) ) {
    29893024                // If this attachment is unattached, attach it. Primarily a back compat thing.
    2990                 if ( 0 == $post->post_parent && $insert_into_post_id = intval( $_POST['post_id'] ) ) {
     3025                $insert_into_post_id = intval( $_POST['post_id'] );
     3026                if ( 0 == $post->post_parent && $insert_into_post_id ) {
    29913027                        wp_update_post(
    29923028                                array(
    … …  
    30533089        check_ajax_referer( 'media-send-to-editor', 'nonce' );
    30543090
    3055         if ( ! $src = wp_unslash( $_POST['src'] ) ) {
     3091        $src = wp_unslash( $_POST['src'] );
     3092        if ( ! $src ) {
    30563093                wp_send_json_error();
    30573094        }
    … …  
    30613098        }
    30623099
    3063         if ( ! $src = esc_url_raw( $src ) ) {
     3100        $src = esc_url_raw( $src );
     3101        if ( ! $src ) {
    30643102                wp_send_json_error();
    30653103        }
    30663104
    3067         if ( ! $link_text = trim( wp_unslash( $_POST['link_text'] ) ) ) {
     3105        $link_text = trim( wp_unslash( $_POST['link_text'] ) );
     3106        if ( ! $link_text ) {
    30683107                $link_text = wp_basename( $src );
    30693108        }
    … …  
    30883127        // Figure out what filter to run:
    30893128        $type = 'file';
    3090         if ( ( $ext = preg_replace( '/^.+?\.([^.]+)$/', '$1', $src ) ) && ( $ext_type = wp_ext2type( $ext ) )
    3091                 && ( 'audio' == $ext_type || 'video' == $ext_type ) ) {
     3129        $ext  = preg_replace( '/^.+?\.([^.]+)$/', '$1', $src );
     3130        if ( $ext ) {
     3131                $ext_type = wp_ext2type( $ext );
     3132                if ( 'audio' == $ext_type || 'video' == $ext_type ) {
    30923133                        $type = $ext_type;
     3134                }
    30933135        }
    30943136
    … …  
    31113153        }
    31123154
    3113         $response    = $data = array();
     3155        $response    = array();
     3156        $data        = array();
    31143157        $nonce_state = wp_verify_nonce( $_POST['_nonce'], 'heartbeat-nonce' );
    31153158
    … …  
    31933236        require ABSPATH . 'wp-admin/includes/revision.php';
    31943237
    3195         if ( ! $post = get_post( (int) $_REQUEST['post_id'] ) ) {
     3238        $post = get_post( (int) $_REQUEST['post_id'] );
     3239        if ( ! $post ) {
    31963240                wp_send_json_error();
    31973241        }
    … …  
    32023246
    32033247        // Really just pre-loading the cache here.
    3204         if ( ! $revisions = wp_get_post_revisions( $post->ID, array( 'check_enabled' => false ) ) ) {
     3248        $revisions = wp_get_post_revisions( $post->ID, array( 'check_enabled' => false ) );
     3249        if ( ! $revisions ) {
    32053250                wp_send_json_error();
    32063251        }
  • trunk/src/wp-admin/includes/class-core-upgrader.php

    r45262 r45583  
    285285                        if ( false === WP_AUTO_UPDATE_CORE ) {
    286286                                // Defaults to turned off, unless a filter allows it
    287                                 $upgrade_dev = $upgrade_minor = $upgrade_major = false;
     287                                $upgrade_dev   = false;
     288                                $upgrade_minor = false;
     289                                $upgrade_major = false;
    288290                        } elseif ( true === WP_AUTO_UPDATE_CORE ) {
    289291                                // ALL updates for core
    290                                 $upgrade_dev = $upgrade_minor = $upgrade_major = true;
     292                                $upgrade_dev   = true;
     293                                $upgrade_minor = true;
     294                                $upgrade_major = true;
    291295                        } elseif ( 'minor' === WP_AUTO_UPDATE_CORE ) {
    292296                                // Only minor updates for core
    293                                 $upgrade_dev   = $upgrade_major = false;
     297                                $upgrade_dev   = false;
    294298                                $upgrade_minor = true;
     299                                $upgrade_major = false;
    295300                        }
    296301                }
  • trunk/src/wp-admin/includes/class-file-upload-upgrader.php

    r42343 r45583  
    100100                } else {
    101101                        // Else, It's set to something, Back compat for plugins using the old (pre-3.3) File_Uploader handler.
    102                         if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) ) {
     102                        $uploads = wp_upload_dir();
     103                        if ( ! ( $uploads && false === $uploads['error'] ) ) {
    103104                                wp_die( $uploads['error'] );
    104105                        }
  • trunk/src/wp-admin/includes/class-language-pack-upgrader.php

    r44676 r45583  
    333333
    334334                // Check to see if a .po and .mo exist in the folder.
    335                 $po = $mo = false;
     335                $po = false;
     336                $mo = false;
    336337                foreach ( (array) $files as $file => $filedata ) {
    337338                        if ( '.po' == substr( $file, -3 ) ) {
  • trunk/src/wp-admin/includes/class-theme-upgrader-skin.php

    r43598 r45583  
    4242
    4343                $update_actions = array();
    44                 if ( ! empty( $this->upgrader->result['destination_name'] ) && $theme_info = $this->upgrader->theme_info() ) {
     44                $theme_info     = $this->upgrader->theme_info();
     45                if ( $theme_info ) {
    4546                        $name       = $theme_info->display( 'Name' );
    4647                        $stylesheet = $this->upgrader->result['destination_name'];
  • trunk/src/wp-admin/includes/class-wp-automatic-updater.php

    r45412 r45583  
    100100                foreach ( $vcs_dirs as $vcs_dir ) {
    101101                        foreach ( $check_dirs as $check_dir ) {
    102                                 if ( $checkout = @is_dir( rtrim( $check_dir, '\\/' ) . "/$vcs_dir" ) ) {
     102                                $checkout = @is_dir( rtrim( $check_dir, '\\/' ) . "/$vcs_dir" );
     103                                if ( $checkout ) {
    103104                                        break 2;
    104105                                }
  • trunk/src/wp-admin/includes/class-wp-comments-list-table.php

    r44759 r45583  
    820820                        $pending_comments = $this->pending_count[ $post->ID ];
    821821                } else {
    822                         $_pending_count_temp = get_pending_comments_num( array( $post->ID ) );
    823                         $pending_comments    = $this->pending_count[ $post->ID ] = $_pending_count_temp[ $post->ID ];
     822                        $_pending_count_temp              = get_pending_comments_num( array( $post->ID ) );
     823                        $pending_comments                 = $_pending_count_temp[ $post->ID ];
     824                        $this->pending_count[ $post->ID ] = $pending_comments;
    824825                }
    825826
    … …  
    832833
    833834                echo '<div class="response-links">';
    834                 if ( 'attachment' === $post->post_type && ( $thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true ) ) ) {
    835                         echo $thumb;
     835                if ( 'attachment' === $post->post_type ) {
     836                        $thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true );
     837                        if ( $thumb ) {
     838                                echo $thumb;
     839                        }
    836840                }
    837841                echo $post_link;
  • trunk/src/wp-admin/includes/class-wp-filesystem-base.php

    r45226 r45583  
    225225                        return $folder;
    226226                }
    227                 if ( $return = $this->search_for_folder( $folder ) ) {
     227                $return = $this->search_for_folder( $folder );
     228                if ( $return ) {
    228229                        $this->cache[ $folder ] = $return;
    229230                }
    … …  
    285286                                // Only search for the remaining path tokens in the directory, not the full path again.
    286287                                $newfolder = implode( '/', array_slice( $folder_parts, $index + 1 ) );
    287                                 if ( $ret = $this->search_for_folder( $newfolder, $newdir, $loop ) ) {
     288                                $ret       = $this->search_for_folder( $newfolder, $newdir, $loop );
     289                                if ( $ret ) {
    288290                                        return $ret;
    289291                                }
    … …  
    399401
    400402                for ( $i = 0, $c = count( $attarray ); $i < $c; $i++ ) {
    401                         if ( $key = array_search( $attarray[ $i ], $legal ) ) {
     403                        $key = array_search( $attarray[ $i ], $legal );
     404                        if ( $key ) {
    402405                                $realmode .= $legal[ $key ];
    403406                        }
  • trunk/src/wp-admin/includes/class-wp-filesystem-ftpext.php

    r45424 r45583  
    591591                        $b['am/pm']  = $lucifer[6];
    592592                        $b['name']   = $lucifer[8];
    593                 } elseif ( ! $is_windows && $lucifer = preg_split( '/[ ]/', $line, 9, PREG_SPLIT_NO_EMPTY ) ) {
    594                         //echo $line."\n";
    595                         $lcount = count( $lucifer );
    596                         if ( $lcount < 8 ) {
    597                                 return '';
    598                         }
    599                         $b           = array();
    600                         $b['isdir']  = $lucifer[0]{0} === 'd';
    601                         $b['islink'] = $lucifer[0]{0} === 'l';
    602                         if ( $b['isdir'] ) {
    603                                 $b['type'] = 'd';
    604                         } elseif ( $b['islink'] ) {
    605                                 $b['type'] = 'l';
    606                         } else {
    607                                 $b['type'] = 'f';
    608                         }
    609                         $b['perms']  = $lucifer[0];
    610                         $b['permsn'] = $this->getnumchmodfromh( $b['perms'] );
    611                         $b['number'] = $lucifer[1];
    612                         $b['owner']  = $lucifer[2];
    613                         $b['group']  = $lucifer[3];
    614                         $b['size']   = $lucifer[4];
    615                         if ( $lcount == 8 ) {
    616                                 sscanf( $lucifer[5], '%d-%d-%d', $b['year'], $b['month'], $b['day'] );
    617                                 sscanf( $lucifer[6], '%d:%d', $b['hour'], $b['minute'] );
    618                                 $b['time'] = @mktime( $b['hour'], $b['minute'], 0, $b['month'], $b['day'], $b['year'] );
    619                                 $b['name'] = $lucifer[7];
    620                         } else {
    621                                 $b['month'] = $lucifer[5];
    622                                 $b['day']   = $lucifer[6];
    623                                 if ( preg_match( '/([0-9]{2}):([0-9]{2})/', $lucifer[7], $l2 ) ) {
    624                                         $b['year']   = gmdate( 'Y' );
    625                                         $b['hour']   = $l2[1];
    626                                         $b['minute'] = $l2[2];
     593                } elseif ( ! $is_windows ) {
     594                        $lucifer = preg_split( '/[ ]/', $line, 9, PREG_SPLIT_NO_EMPTY );
     595                        if ( $lucifer ) {
     596                                //echo $line."\n";
     597                                $lcount = count( $lucifer );
     598                                if ( $lcount < 8 ) {
     599                                        return '';
     600                                }
     601                                $b           = array();
     602                                $b['isdir']  = $lucifer[0]{0} === 'd';
     603                                $b['islink'] = $lucifer[0]{0} === 'l';
     604                                if ( $b['isdir'] ) {
     605                                        $b['type'] = 'd';
     606                                } elseif ( $b['islink'] ) {
     607                                        $b['type'] = 'l';
    627608                                } else {
    628                                         $b['year']   = $lucifer[7];
    629                                         $b['hour']   = 0;
    630                                         $b['minute'] = 0;
     609                                        $b['type'] = 'f';
    631610                                }
    632                                 $b['time'] = strtotime( sprintf( '%d %s %d %02d:%02d', $b['day'], $b['month'], $b['year'], $b['hour'], $b['minute'] ) );
    633                                 $b['name'] = $lucifer[8];
     611                                $b['perms']  = $lucifer[0];
     612                                $b['permsn'] = $this->getnumchmodfromh( $b['perms'] );
     613                                $b['number'] = $lucifer[1];
     614                                $b['owner']  = $lucifer[2];
     615                                $b['group']  = $lucifer[3];
     616                                $b['size']   = $lucifer[4];
     617                                if ( $lcount == 8 ) {
     618                                        sscanf( $lucifer[5], '%d-%d-%d', $b['year'], $b['month'], $b['day'] );
     619                                        sscanf( $lucifer[6], '%d:%d', $b['hour'], $b['minute'] );
     620                                        $b['time'] = @mktime( $b['hour'], $b['minute'], 0, $b['month'], $b['day'], $b['year'] );
     621                                        $b['name'] = $lucifer[7];
     622                                } else {
     623                                        $b['month'] = $lucifer[5];
     624                                        $b['day']   = $lucifer[6];
     625                                        if ( preg_match( '/([0-9]{2}):([0-9]{2})/', $lucifer[7], $l2 ) ) {
     626                                                $b['year']   = gmdate( 'Y' );
     627                                                $b['hour']   = $l2[1];
     628                                                $b['minute'] = $l2[2];
     629                                        } else {
     630                                                $b['year']   = $lucifer[7];
     631                                                $b['hour']   = 0;
     632                                                $b['minute'] = 0;
     633                                        }
     634                                        $b['time'] = strtotime( sprintf( '%d %s %d %02d:%02d', $b['day'], $b['month'], $b['year'], $b['hour'], $b['minute'] ) );
     635                                        $b['name'] = $lucifer[8];
     636                                }
    634637                        }
    635638                }
  • trunk/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php

    r45226 r45583  
    137137                $temp = wp_tempnam( $file );
    138138
    139                 if ( ! $temphandle = fopen( $temp, 'w+' ) ) {
     139                $temphandle = fopen( $temp, 'w+' );
     140                if ( ! $temphandle ) {
    140141                        unlink( $temp );
    141142                        return false;
    … …  
    191192         */
    192193        public function put_contents( $file, $contents, $mode = false ) {
    193                 $temp = wp_tempnam( $file );
    194                 if ( ! $temphandle = @fopen( $temp, 'w+' ) ) {
     194                $temp       = wp_tempnam( $file );
     195                $temphandle = @fopen( $temp, 'w+' );
     196                if ( ! $temphandle ) {
    195197                        unlink( $temp );
    196198                        return false;
  • trunk/src/wp-admin/includes/class-wp-filesystem-ssh2.php

    r45424 r45583  
    222222                }
    223223
    224                 if ( ! ( $stream = ssh2_exec( $this->link, $command ) ) ) {
     224                $stream = ssh2_exec( $this->link, $command );
     225                if ( ! $stream ) {
    225226                        $this->errors->add(
    226227                                'command',
  • trunk/src/wp-admin/includes/class-wp-importer.php

    r42771 r45583  
    131131                        $blog_id = (int) $blog_id;
    132132                } else {
    133                         $blog = 'http://' . preg_replace( '#^https?://#', '', $blog_id );
    134                         if ( ( ! $parsed = parse_url( $blog ) ) || empty( $parsed['host'] ) ) {
     133                        $blog   = 'http://' . preg_replace( '#^https?://#', '', $blog_id );
     134                        $parsed = parse_url( $blog );
     135                        if ( ! $parsed || empty( $parsed['host'] ) ) {
    135136                                fwrite( STDERR, "Error: can not determine blog_id from $blog_id\n" );
    136137                                exit();
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r44574 r45583  
    805805                $total_pages_after  = '</span></span>';
    806806
    807                 $disable_first = $disable_last = $disable_prev = $disable_next = false;
     807                $disable_first = false;
     808                $disable_last  = false;
     809                $disable_prev  = false;
     810                $disable_next  = false;
    808811
    809812                if ( $current == 1 ) {
  • trunk/src/wp-admin/includes/class-wp-media-list-table.php

    r45147 r45583  
    378378                $title      = _draft_or_post_title();
    379379                $thumb      = wp_get_attachment_image( $post->ID, array( 60, 60 ), true, array( 'alt' => '' ) );
    380                 $link_start = $link_end = '';
     380                $link_start = '';
     381                $link_end   = '';
    381382
    382383                if ( current_user_can( 'edit_post', $post->ID ) && ! $this->is_trash ) {
    … …  
    453454                        $m_time = $post->post_date;
    454455                        $time   = get_post_time( 'G', true, $post, false );
    455                         if ( ( abs( $t_diff = time() - $time ) ) < DAY_IN_SECONDS ) {
     456                        $t_diff = time() - $time;
     457                        if ( ( abs( $t_diff ) ) < DAY_IN_SECONDS ) {
    456458                                if ( $t_diff < 0 ) {
    457459                                        $h_time = sprintf( __( '%s from now' ), human_time_diff( $time ) );
  • trunk/src/wp-admin/includes/class-wp-ms-sites-list-table.php

    r43571 r45583  
    9494                if ( ! $s && wp_is_large_network() ) {
    9595                        if ( ! isset( $_REQUEST['orderby'] ) ) {
    96                                 $_GET['orderby'] = $_REQUEST['orderby'] = '';
     96                                $_GET['orderby']     = '';
     97                                $_REQUEST['orderby'] = '';
    9798                        }
    9899                        if ( ! isset( $_REQUEST['order'] ) ) {
    99                                 $_GET['order'] = $_REQUEST['order'] = 'DESC';
     100                                $_GET['order']     = 'DESC';
     101                                $_REQUEST['order'] = 'DESC';
    100102                        }
    101103                }
  • trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php

    r43571 r45583  
    116116                }
    117117
    118                 $maybe_update = current_user_can( 'update_themes' ) && ! $this->is_site_themes && $current = get_site_transient( 'update_themes' );
     118                $current      = get_site_transient( 'update_themes' );
     119                $maybe_update = current_user_can( 'update_themes' ) && ! $this->is_site_themes && $current;
    119120
    120121                foreach ( (array) $themes['all'] as $key => $theme ) {
  • trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php

    r45252 r45583  
    6666                if ( ! $usersearch && wp_is_large_network( 'users' ) ) {
    6767                        if ( ! isset( $_REQUEST['orderby'] ) ) {
    68                                 $_GET['orderby'] = $_REQUEST['orderby'] = 'id';
     68                                $_GET['orderby']     = 'id';
     69                                $_REQUEST['orderby'] = 'id';
    6970                        }
    7071                        if ( ! isset( $_REQUEST['order'] ) ) {
    71                                 $_GET['order'] = $_REQUEST['order'] = 'DESC';
     72                                $_GET['order']     = 'DESC';
     73                                $_REQUEST['order'] = 'DESC';
    7274                        }
    7375                        $args['count_total'] = false;
    … …  
    472474
    473475                if ( current_user_can( 'delete_user', $user->ID ) && ! in_array( $user->user_login, $super_admins ) ) {
    474                         $actions['delete'] = '<a href="' . $delete = esc_url( network_admin_url( add_query_arg( '_wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'users.php', 'deleteuser' ) . '&amp;action=deleteuser&amp;id=' . $user->ID ) ) ) . '" class="delete">' . __( 'Delete' ) . '</a>';
     476                        $actions['delete'] = '<a href="' . esc_url( network_admin_url( add_query_arg( '_wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'users.php', 'deleteuser' ) . '&amp;action=deleteuser&amp;id=' . $user->ID ) ) ) . '" class="delete">' . __( 'Delete' ) . '</a>';
    475477                }
    476478
  • trunk/src/wp-admin/includes/class-wp-posts-list-table.php

    r45136 r45583  
    110110                }
    111111
    112                 if ( 'post' === $post_type && $sticky_posts = get_option( 'sticky_posts' ) ) {
     112                $sticky_posts = get_option( 'sticky_posts' );
     113                if ( 'post' === $post_type && $sticky_posts ) {
    113114                        $sticky_posts             = implode( ', ', array_map( 'absint', (array) $sticky_posts ) );
    114115                        $this->sticky_posts_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( 1 ) FROM $wpdb->posts WHERE post_type = %s AND post_status NOT IN ('trash', 'auto-draft') AND ID IN ($sticky_posts)", $post_type ) );
    … …  
    244245                $url = add_query_arg( $args, 'edit.php' );
    245246
    246                 $class_html = $aria_current = '';
     247                $class_html   = '';
     248                $aria_current = '';
    247249                if ( ! empty( $class ) ) {
    248250                        $class_html = sprintf(
    … …  
    996998                                $locked_text   = esc_html( sprintf( __( '%s is currently editing' ), $lock_holder->display_name ) );
    997999                        } else {
    998                                 $locked_avatar = $locked_text = '';
     1000                                $locked_avatar = '';
     1001                                $locked_text   = '';
    9991002                        }
    10001003
    … …  
    10551058
    10561059                if ( '0000-00-00 00:00:00' === $post->post_date ) {
    1057                         $t_time    = $h_time = __( 'Unpublished' );
     1060                        $t_time    = __( 'Unpublished' );
     1061                        $h_time    = $t_time;
    10581062                        $time_diff = 0;
    10591063                } else {
    … …  
    15751579                                        }
    15761580
    1577                                         if ( $authors = wp_dropdown_users( $users_opt ) ) :
     1581                                        $authors = wp_dropdown_users( $users_opt );
     1582                                        if ( $authors ) :
    15781583                                                $authors_dropdown  = '<label class="inline-edit-author">';
    15791584                                                $authors_dropdown .= '<span class="title">' . __( 'Author' ) . '</span>';
  • trunk/src/wp-admin/includes/class-wp-privacy-policy-content.php

    r45448 r45583  
    242242                                } elseif ( $new_data['plugin_name'] === $old_data['plugin_name'] ) {
    243243                                        // The info for the policy was updated.
    244                                         $checked[] = array(
     244                                        $checked[]    = array(
    245245                                                'plugin_name' => $new_data['plugin_name'],
    246246                                                'policy_text' => $new_data['policy_text'],
    247247                                                'updated'     => $time,
    248248                                        );
    249                                         $found     = $update_cache = true;
     249                                        $found        = true;
     250                                        $update_cache = true;
    250251                                }
    251252
    … …  
    379380
    380381                foreach ( $content_array as $section ) {
    381                         $class = $meta = $removed = '';
     382                        $class   = '';
     383                        $meta    = '';
     384                        $removed = '';
    382385
    383386                        if ( ! empty( $section['removed'] ) ) {
  • trunk/src/wp-admin/includes/class-wp-screen.php

    r45503 r45583  
    203203                }
    204204
    205                 $post_type       = $taxonomy = null;
     205                $post_type       = null;
     206                $taxonomy        = null;
    206207                $in_admin        = false;
    207208                $action          = '';
    … …  
    10161017                );
    10171018
    1018                 $wrapper_start = $wrapper_end = $form_start = $form_end = '';
     1019                $wrapper_start = '';
     1020                $wrapper_end   = '';
     1021                $form_start    = '';
     1022                $form_end      = '';
    10191023
    10201024                // Output optional wrapper.
  • trunk/src/wp-admin/includes/class-wp-terms-list-table.php

    r44804 r45583  
    227227                $number = $args['number'];
    228228
    229                 $args['offset'] = $offset = ( $page - 1 ) * $number;
     229                $offset         = ( $page - 1 ) * $number;
     230                $args['offset'] = $offset;
    230231
    231232                // Convert it to table rows.
    … …  
    234235                if ( is_taxonomy_hierarchical( $taxonomy ) && ! isset( $args['orderby'] ) ) {
    235236                        // We'll need the full set of terms then.
    236                         $args['number'] = $args['offset'] = 0;
     237                        $args['number'] = 0;
     238                        $args['offset'] = $args['number'];
    237239                }
    238240                $terms = get_terms( $taxonomy, $args );
    … …  
    286288                        // If the page starts in a subtree, print the parents.
    287289                        if ( $count == $start && $term->parent > 0 && empty( $_REQUEST['s'] ) ) {
    288                                 $my_parents = $parent_ids = array();
     290                                $my_parents = array();
     291                                $parent_ids = array();
    289292                                $p          = $term->parent;
    290293                                while ( $p ) {
  • trunk/src/wp-admin/includes/class-wp-themes-list-table.php

    r45080 r45583  
    209209                        unset( $actions['delete'] );
    210210
     211                        $screenshot = $theme->get_screenshot();
    211212                        ?>
    212213
    213214                        <span class="screenshot hide-if-customize">
    214                                 <?php if ( $screenshot = $theme->get_screenshot() ) : ?>
     215                                <?php if ( $screenshot ) : ?>
    215216                                        <img src="<?php echo esc_url( $screenshot ); ?>" alt="" />
    216217                                <?php endif; ?>
    217218                        </span>
    218219                        <a href="<?php echo wp_customize_url( $stylesheet ); ?>" class="screenshot load-customize hide-if-no-customize">
    219                                 <?php if ( $screenshot = $theme->get_screenshot() ) : ?>
     220                                <?php if ( $screenshot ) : ?>
    220221                                        <img src="<?php echo esc_url( $screenshot ); ?>" alt="" />
    221222                                <?php endif; ?>
  • trunk/src/wp-admin/includes/class-wp-upgrader.php

    r45262 r45583  
    186186                global $wp_filesystem;
    187187
    188                 if ( false === ( $credentials = $this->skin->request_filesystem_credentials( false, $directories[0], $allow_relaxed_file_ownership ) ) ) {
     188                $credentials = $this->skin->request_filesystem_credentials( false, $directories[0], $allow_relaxed_file_ownership );
     189                if ( false === $credentials ) {
    189190                        return false;
    190191                }
  • trunk/src/wp-admin/includes/comment.php

    r42343 r45583  
    105105 */
    106106function get_comment_to_edit( $id ) {
    107         if ( ! $comment = get_comment( $id ) ) {
     107        $comment = get_comment( $id );
     108        if ( ! $comment ) {
    108109                return false;
    109110        }
  • trunk/src/wp-admin/includes/dashboard.php

    r45536 r45583  
    596596                echo '<div class="draft-title"><a href="' . esc_url( $url ) . '" aria-label="' . esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ) . '">' . esc_html( $title ) . '</a>';
    597597                echo '<time datetime="' . get_the_time( 'c', $draft ) . '">' . get_the_time( __( 'F j, Y' ), $draft ) . '</time></div>';
    598                 if ( $the_content = wp_trim_words( $draft->post_content, $draft_length ) ) {
     598                $the_content = wp_trim_words( $draft->post_content, $draft_length );
     599                if ( $the_content ) {
    599600                        echo '<p>' . $the_content . '</p>';
    600601                }
    … …  
    10131014        $locale    = get_user_locale();
    10141015        $cache_key = 'dash_v2_' . md5( $widget_id . '_' . $locale );
    1015         if ( false !== ( $output = get_transient( $cache_key ) ) ) {
     1016        $output    = get_transient( $cache_key );
     1017        if ( false !== $output ) {
    10161018                echo $output;
    10171019                return true;
    … …  
    10741076 */
    10751077function wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) {
    1076         if ( ! $widget_options = get_option( 'dashboard_widget_options' ) ) {
     1078        $widget_options = get_option( 'dashboard_widget_options' );
     1079        if ( ! $widget_options ) {
    10771080                $widget_options = array();
    10781081        }
    … …  
    15671570        $key = md5( $_SERVER['HTTP_USER_AGENT'] );
    15681571
    1569         if ( false === ( $response = get_site_transient( 'browser_' . $key ) ) ) {
     1572        $response = get_site_transient( 'browser_' . $key );
     1573        if ( false === $response ) {
    15701574                // include an unmodified $wp_version
    15711575                include( ABSPATH . WPINC . '/version.php' );
  • trunk/src/wp-admin/includes/edit-tag-messages.php

    r42343 r45583  
    5050
    5151$message = false;
    52 if ( isset( $_REQUEST['message'] ) && ( $msg = (int) $_REQUEST['message'] ) ) {
     52if ( isset( $_REQUEST['message'] ) && (int) $_REQUEST['message'] ) {
     53        $msg = (int) $_REQUEST['message'];
    5354        if ( isset( $messages[ $taxonomy ][ $msg ] ) ) {
    5455                $message = $messages[ $taxonomy ][ $msg ];
  • trunk/src/wp-admin/includes/export.php

    r45424 r45583  
    118118        $join = '';
    119119        if ( $args['category'] && 'post' == $args['content'] ) {
    120                 if ( $term = term_exists( $args['category'], 'category' ) ) {
     120                $term = term_exists( $args['category'], 'category' );
     121                if ( $term ) {
    121122                        $join   = "INNER JOIN {$wpdb->term_relationships} ON ({$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id)";
    122123                        $where .= $wpdb->prepare( " AND {$wpdb->term_relationships}.term_taxonomy_id = %d", $term['term_taxonomy_id'] );
    … …  
    145146         * or all content.
    146147         */
    147         $cats = $tags = $terms = array();
     148        $cats  = array();
     149        $tags  = array();
     150        $terms = array();
    148151        if ( isset( $term ) && $term ) {
    149152                $cat  = get_term( $term['term_id'], 'category' );
  • trunk/src/wp-admin/includes/file.php

    r45580 r45583  
    822822         * overriding this one.
    823823         */
    824         if ( ! ( ( $uploads = wp_upload_dir( $time ) ) && false === $uploads['error'] ) ) {
     824        $uploads = wp_upload_dir( $time );
     825        if ( ! ( $uploads && false === $uploads['error'] ) ) {
    825826                return call_user_func_array( $upload_error_handler, array( &$file, $uploads['error'] ) );
    826827        }
    … …  
    12521253        mbstring_binary_safe_encoding();
    12531254
    1254         $skipped_key = $skipped_signature = 0;
     1255        $skipped_key       = 0;
     1256        $skipped_signature = 0;
    12551257
    12561258        foreach ( (array) $signatures as $signature ) {
    … …  
    14331435
    14341436        for ( $i = 0; $i < $z->numFiles; $i++ ) {
    1435                 if ( ! $info = $z->statIndex( $i ) ) {
     1437                $info = $z->statIndex( $i );
     1438                if ( ! $info ) {
    14361439                        return new WP_Error( 'stat_failed_ziparchive', __( 'Could not retrieve file from archive.' ) );
    14371440                }
    … …  
    14481451                $uncompressed_size += $info['size'];
    14491452
     1453                $dirname = dirname( $info['name'] );
     1454
    14501455                if ( '/' === substr( $info['name'], -1 ) ) {
    14511456                        // Directory.
    14521457                        $needed_dirs[] = $to . untrailingslashit( $info['name'] );
    1453                 } elseif ( '.' !== $dirname = dirname( $info['name'] ) ) {
     1458                } elseif ( '.' !== $dirname ) {
    14541459                        // Path to a file.
    14551460                        $needed_dirs[] = $to . untrailingslashit( $dirname );
    … …  
    14971502
    14981503        for ( $i = 0; $i < $z->numFiles; $i++ ) {
    1499                 if ( ! $info = $z->statIndex( $i ) ) {
     1504                $info = $z->statIndex( $i );
     1505                if ( ! $info ) {
    15001506                        return new WP_Error( 'stat_failed_ziparchive', __( 'Could not retrieve file from archive.' ) );
    15011507                }
    … …  
    18301836
    18311837                        // Attempt to determine the file owner of the WordPress files, and that of newly created files
    1832                         $wp_file_owner = $temp_file_owner = false;
     1838                        $wp_file_owner   = false;
     1839                        $temp_file_owner = false;
    18331840                        if ( function_exists( 'fileowner' ) ) {
    18341841                                $wp_file_owner   = @fileowner( __FILE__ );
  • trunk/src/wp-admin/includes/image-edit.php

    r45499 r45583  
    655655 */
    656656function wp_restore_image( $post_id ) {
    657         $meta         = wp_get_attachment_metadata( $post_id );
    658         $file         = get_attached_file( $post_id );
    659         $backup_sizes = $old_backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );
    660         $restored     = false;
    661         $msg          = new stdClass;
     657        $meta             = wp_get_attachment_metadata( $post_id );
     658        $file             = get_attached_file( $post_id );
     659        $backup_sizes     = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );
     660        $old_backup_sizes = $backup_sizes;
     661        $restored         = false;
     662        $msg              = new stdClass;
    662663
    663664        if ( ! is_array( $backup_sizes ) ) {
    … …  
    748749
    749750        $return  = new stdClass;
    750         $success = $delete = $scaled = $nocrop = false;
     751        $success = false;
     752        $delete  = false;
     753        $scaled  = false;
     754        $nocrop  = false;
    751755        $post    = get_post( $post_id );
    752756
    … …  
    875879        } elseif ( 'thumbnail' == $target ) {
    876880                $sizes   = array( 'thumbnail' );
    877                 $success = $delete = $nocrop = true;
     881                $success = true;
     882                $delete  = true;
     883                $nocrop  = true;
    878884        }
    879885
    … …  
    945951                        } else {
    946952                                $file_url = wp_get_attachment_url( $post_id );
    947                                 if ( ! empty( $meta['sizes']['thumbnail'] ) && $thumb = $meta['sizes']['thumbnail'] ) {
     953                                if ( ! empty( $meta['sizes']['thumbnail'] ) ) {
     954                                        $thumb             = $meta['sizes']['thumbnail'];
    948955                                        $return->thumbnail = path_join( dirname( $file_url ), $thumb['file'] );
    949956                                } else {
  • trunk/src/wp-admin/includes/media.php

    r45499 r45583  
    288288
    289289        $time = current_time( 'mysql' );
    290         if ( $post = get_post( $post_id ) ) {
     290        $post = get_post( $post_id );
     291        if ( $post ) {
    291292                // The post date doesn't usually matter for pages, so don't backdate this upload.
    292293                if ( 'page' !== $post->post_type && substr( $post->post_date, 0, 4 ) > 0 ) {
    … …  
    370371
    371372                // Use image exif/iptc data for title and caption defaults if possible.
    372         } elseif ( 0 === strpos( $type, 'image/' ) && $image_meta = wp_read_image_metadata( $file ) ) {
    373                 if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) {
    374                         $title = $image_meta['title'];
    375                 }
    376 
    377                 if ( trim( $image_meta['caption'] ) ) {
    378                         $excerpt = $image_meta['caption'];
     373        } elseif ( 0 === strpos( $type, 'image/' ) ) {
     374                $image_meta = wp_read_image_metadata( $file );
     375                if ( $image_meta ) {
     376                        if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) {
     377                                $title = $image_meta['title'];
     378                        }
     379
     380                        if ( trim( $image_meta['caption'] ) ) {
     381                                $excerpt = $image_meta['caption'];
     382                        }
    379383                }
    380384        }
    … …  
    421425
    422426        $time = current_time( 'mysql' );
    423         if ( $post = get_post( $post_id ) ) {
     427        $post = get_post( $post_id );
     428        if ( $post ) {
    424429                if ( substr( $post->post_date, 0, 4 ) > 0 ) {
    425430                        $time = $post->post_date;
    … …  
    439444
    440445        // Use image exif/iptc data for title and caption defaults if possible.
    441         if ( $image_meta = wp_read_image_metadata( $file ) ) {
     446        $image_meta = wp_read_image_metadata( $file );
     447        if ( $image_meta ) {
    442448                if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) {
    443449                        $title = $image_meta['title'];
    … …  
    693699        if ( ! empty( $_POST['attachments'] ) ) {
    694700                foreach ( $_POST['attachments'] as $attachment_id => $attachment ) {
    695                         $post = $_post = get_post( $attachment_id, ARRAY_A );
     701                        $post  = get_post( $attachment_id, ARRAY_A );
     702                        $_post = $post;
    696703
    697704                        if ( ! current_user_can( 'edit_post', $attachment_id ) ) {
    … …  
    836843
    837844                        $type = 'file';
    838                         if ( ( $ext = preg_replace( '/^.+?\.([^.]+)$/', '$1', $src ) ) && ( $ext_type = wp_ext2type( $ext ) )
    839                                 && ( 'audio' == $ext_type || 'video' == $ext_type ) ) {
     845                        $ext  = preg_replace( '/^.+?\.([^.]+)$/', '$1', $src );
     846                        if ( $ext ) {
     847                                $ext_type = wp_ext2type( $ext );
     848                                if ( 'audio' == $ext_type || 'video' == $ext_type ) {
    840849                                        $type = $ext_type;
     850                                }
    841851                        }
    842852
    … …  
    14411451                        continue;
    14421452                }
    1443                 if ( $item = get_media_item( $id, array( 'errors' => isset( $errors[ $id ] ) ? $errors[ $id ] : null ) ) ) {
     1453                $item = get_media_item( $id, array( 'errors' => isset( $errors[ $id ] ) ? $errors[ $id ] : null ) );
     1454                if ( $item ) {
    14441455                        $output .= "\n<div id='media-item-$id' class='media-item child-of-$attachment->post_parent preloaded'><div class='progress hidden'><div class='bar'></div></div><div id='media-upload-error-$id' class='hidden'></div><div class='filename hidden'></div>$item\n</div>";
    14451456                }
    … …  
    14631474        global $redir_tab;
    14641475
    1465         if ( ( $attachment_id = intval( $attachment_id ) ) && $thumb_url = wp_get_attachment_image_src( $attachment_id, 'thumbnail', true ) ) {
    1466                 $thumb_url = $thumb_url[0];
    1467         } else {
    1468                 $thumb_url = false;
     1476        $thumb_url     = false;
     1477        $attachment_id = intval( $attachment_id );
     1478
     1479        if ( $attachment_id ) {
     1480                $thumb_url = wp_get_attachment_image_src( $attachment_id, 'thumbnail', true );
     1481                if ( $thumb_url ) {
     1482                        $thumb_url = $thumb_url[0];
     1483                }
    14691484        }
    14701485
    … …  
    27542769                $table_class = '';
    27552770        } else {
    2756                 $view = $table_class = 'not-image';
     2771                $view        = 'not-image';
     2772                $table_class = $view;
    27572773        }
    27582774
    … …  
    28372853        $browser_uploader = admin_url( 'media-new.php?browser-uploader' );
    28382854
    2839         if ( $post = get_post() ) {
     2855        $post = get_post();
     2856        if ( $post ) {
    28402857                $browser_uploader .= '&amp;post_id=' . intval( $post->ID );
    28412858        } elseif ( ! empty( $GLOBALS['post_ID'] ) ) {
    … …  
    28772894function media_upload_max_image_resize() {
    28782895        $checked = get_user_setting( 'upload_resize' ) ? ' checked="true"' : '';
    2879         $a       = $end = '';
     2896        $a       = '';
     2897        $end     = '';
    28802898
    28812899        if ( current_user_can( 'manage_options' ) ) {
    … …  
    29202938        }
    29212939
    2922         $thumb_url = false;
    2923         if ( $attachment_id = intval( $post->ID ) ) {
     2940        $thumb_url     = false;
     2941        $attachment_id = intval( $post->ID );
     2942        if ( $attachment_id ) {
    29242943                $thumb_url = wp_get_attachment_image_src( $attachment_id, array( 900, 450 ), true );
    29252944        }
    … …  
    29382957                }
    29392958
    2940                 $open_style = $not_open_style = '';
     2959                $open_style     = '';
     2960                $not_open_style = '';
    29412961                if ( $open ) {
    29422962                        $open_style = ' style="display:none"';
    … …  
    35123532        if ( isset( $result ) ) {
    35133533                $location = 'upload.php';
    3514                 if ( $referer = wp_get_referer() ) {
     3534                $referer  = wp_get_referer();
     3535                if ( $referer ) {
    35153536                        if ( false !== strpos( $referer, 'upload.php' ) ) {
    35163537                                $location = remove_query_arg( array( 'attached', 'detach' ), $referer );
  • trunk/src/wp-admin/includes/menu.php

    r42343 r45583  
    4444// Create list of page plugin hook names.
    4545foreach ( $menu as $menu_page ) {
    46         if ( false !== $pos = strpos( $menu_page[2], '?' ) ) {
     46        $pos = strpos( $menu_page[2], '?' );
     47        if ( false !== $pos ) {
    4748                // Handle post_type=post|page|foo pages.
    4849                $hook_name = substr( $menu_page[2], 0, $pos );
    … …  
    201202 */
    202203function add_menu_classes( $menu ) {
    203         $first = $lastorder = false;
    204         $i     = 0;
    205         $mc    = count( $menu );
     204        $first     = false;
     205        $lastorder = false;
     206        $i         = 0;
     207        $mc        = count( $menu );
    206208        foreach ( $menu as $order => $top ) {
    207209                $i++;
  • trunk/src/wp-admin/includes/misc.php

    r45580 r45583  
    137137
    138138        // Split out the existing file into the preceding lines, and those that appear after the marker
    139         $pre_lines    = $post_lines = $existing_lines = array();
    140         $found_marker = $found_end_marker = false;
     139        $pre_lines        = array();
     140        $post_lines       = array();
     141        $existing_lines   = array();
     142        $found_marker     = false;
     143        $found_end_marker = false;
    141144        foreach ( $lines as $line ) {
    142145                if ( ! $found_marker && false !== strpos( $line, $start_marker ) ) {
    … …  
    597600                check_admin_referer( 'screen-options-nonce', 'screenoptionnonce' );
    598601
    599                 if ( ! $user = wp_get_current_user() ) {
     602                $user = wp_get_current_user();
     603                if ( ! $user ) {
    600604                        return;
    601605                }
    … …  
    965969        if ( array_key_exists( 'wp-check-locked-posts', $data ) && is_array( $data['wp-check-locked-posts'] ) ) {
    966970                foreach ( $data['wp-check-locked-posts'] as $key ) {
    967                         if ( ! $post_id = absint( substr( $key, 5 ) ) ) {
     971                        $post_id = absint( substr( $key, 5 ) );
     972                        if ( ! $post_id ) {
    968973                                continue;
    969974                        }
    970975
    971                         if ( ( $user_id = wp_check_post_lock( $post_id ) ) && ( $user = get_userdata( $user_id ) ) && current_user_can( 'edit_post', $post_id ) ) {
    972                                 $send = array( 'text' => sprintf( __( '%s is currently editing' ), $user->display_name ) );
    973 
    974                                 if ( ( $avatar = get_avatar( $user->ID, 18 ) ) && preg_match( "|src='([^']+)'|", $avatar, $matches ) ) {
    975                                         $send['avatar_src'] = $matches[1];
     976                        $user_id = wp_check_post_lock( $post_id );
     977                        if ( $user_id ) {
     978                                $user = get_userdata( $user_id );
     979                                if ( $user && current_user_can( 'edit_post', $post_id ) ) {
     980                                        $send = array( 'text' => sprintf( __( '%s is currently editing' ), $user->display_name ) );
     981
     982                                        $avatar = get_avatar( $user->ID, 18 );
     983                                        if ( $avatar && preg_match( "|src='([^']+)'|", $avatar, $matches ) ) {
     984                                                $send['avatar_src'] = $matches[1];
     985                                        }
     986
     987                                        $checked[ $key ] = $send;
    976988                                }
    977 
    978                                 $checked[ $key ] = $send;
    979989                        }
    980990                }
    … …  
    10031013                $send     = array();
    10041014
    1005                 if ( ! $post_id = absint( $received['post_id'] ) ) {
     1015                $post_id = absint( $received['post_id'] );
     1016                if ( ! $post_id ) {
    10061017                        return $response;
    10071018                }
    … …  
    10111022                }
    10121023
    1013                 if ( ( $user_id = wp_check_post_lock( $post_id ) ) && ( $user = get_userdata( $user_id ) ) ) {
     1024                $user_id = wp_check_post_lock( $post_id );
     1025                $user    = get_userdata( $user_id );
     1026                if ( $user ) {
    10141027                        $error = array(
    10151028                                'text' => sprintf( __( '%s has taken over and is currently editing.' ), $user->display_name ),
    10161029                        );
    10171030
    1018                         if ( $avatar = get_avatar( $user->ID, 64 ) ) {
     1031                        $avatar = get_avatar( $user->ID, 64 );
     1032                        if ( $avatar ) {
    10191033                                if ( preg_match( "|src='([^']+)'|", $avatar, $matches ) ) {
    10201034                                        $error['avatar_src'] = $matches[1];
    … …  
    10241038                        $send['lock_error'] = $error;
    10251039                } else {
    1026                         if ( $new_lock = wp_set_post_lock( $post_id ) ) {
     1040                        $new_lock = wp_set_post_lock( $post_id );
     1041                        if ( $new_lock ) {
    10271042                                $send['new_lock'] = implode( ':', $new_lock );
    10281043                        }
    … …  
    10501065                $response['wp-refresh-post-nonces'] = array( 'check' => 1 );
    10511066
    1052                 if ( ! $post_id = absint( $received['post_id'] ) ) {
     1067                $post_id = absint( $received['post_id'] );
     1068                if ( ! $post_id ) {
    10531069                        return $response;
    10541070                }
  • trunk/src/wp-admin/includes/ms.php

    r45579 r45583  
    368368        $id = (int) $id;
    369369
    370         if ( ! $user = get_userdata( $id ) ) {
     370        $user = get_userdata( $id );
     371        if ( ! $user ) {
    371372                return false;
    372373        }
    … …  
    909910        <table class="form-table" role="presentation">
    910911        <?php
    911         foreach ( ( $allusers = (array) $_POST['allusers'] ) as $user_id ) {
     912        $allusers = (array) $_POST['allusers'];
     913        foreach ( $allusers as $user_id ) {
    912914                if ( $user_id != '' && $user_id != '0' ) {
    913915                        $delete_user = get_userdata( $user_id );
  • trunk/src/wp-admin/includes/nav-menu.php

    r44686 r45583  
    412412        );
    413413
    414         $most_recent_url = $view_all_url = $search_url = '';
     414        $most_recent_url = '';
     415        $view_all_url    = '';
     416        $search_url      = '';
    415417        if ( $nav_menu_selected_id ) {
    416418                $most_recent_url = esc_url( add_query_arg( $post_type_name . '-tab', 'most-recent', remove_query_arg( $removed_args ) ) );
    … …  
    741743        );
    742744
    743         $most_used_url = $view_all_url = $search_url = '';
     745        $most_used_url = '';
     746        $view_all_url  = '';
     747        $search_url    = '';
    744748        if ( $nav_menu_selected_id ) {
    745749                $most_used_url = esc_url( add_query_arg( $taxonomy_name . '-tab', 'most-used', remove_query_arg( $removed_args ) ) );
    … …  
    10281032                }
    10291033
    1030                 $some_pending_menu_items = $some_invalid_menu_items = false;
     1034                $some_pending_menu_items = false;
     1035                $some_invalid_menu_items = false;
    10311036                foreach ( (array) $menu_items as $menu_item ) {
    10321037                        if ( isset( $menu_item->post_status ) && 'draft' == $menu_item->post_status ) {
    … …  
    11821187                }
    11831188        } else {
    1184                 if ( false !== ( $key = array_search( $nav_menu_selected_id, $nav_menu_option['auto_add'] ) ) ) {
     1189                $key = array_search( $nav_menu_selected_id, $nav_menu_option['auto_add'] );
     1190                if ( false !== $key ) {
    11851191                        unset( $nav_menu_option['auto_add'][ $key ] );
    11861192                }
  • trunk/src/wp-admin/includes/network.php

    r45416 r45583  
    8383 */
    8484function get_clean_basedomain() {
    85         if ( $existing_domain = network_domain_check() ) {
     85        $existing_domain = network_domain_check();
     86        if ( $existing_domain ) {
    8687                return $existing_domain;
    8788        }
    8889        $domain = preg_replace( '|https?://|', '', get_option( 'siteurl' ) );
    89         if ( $slash = strpos( $domain, '/' ) ) {
     90        $slash  = strpos( $domain, '/' );
     91        if ( $slash ) {
    9092                $domain = substr( $domain, 0, $slash );
    9193        }
    … …  
    186188        } else {
    187189                $subdomain_install = false;
    188                 if ( $got_mod_rewrite = got_mod_rewrite() ) { // dangerous assumptions
     190                $got_mod_rewrite   = got_mod_rewrite();
     191                if ( $got_mod_rewrite ) { // dangerous assumptions
    189192                        echo '<div class="updated inline"><p><strong>' . __( 'Note:' ) . '</strong> ';
    190193                        /* translators: %s: mod_rewrite */
  • trunk/src/wp-admin/includes/plugin-install.php

    r45563 r45583  
    161161
    162162                $http_url = $url;
    163                 if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
     163                $ssl      = wp_http_supports( array( 'ssl' ) );
     164                if ( $ssl ) {
    164165                        $url = set_url_scheme( $url, 'https' );
    165166                }
    … …  
    239240 */
    240241function install_popular_tags( $args = array() ) {
    241         $key = md5( serialize( $args ) );
    242         if ( false !== ( $tags = get_site_transient( 'poptags_' . $key ) ) ) {
     242        $key  = md5( serialize( $args ) );
     243        $tags = get_site_transient( 'poptags_' . $key );
     244        if ( false !== $tags ) {
    243245                return $tags;
    244246        }
  • trunk/src/wp-admin/includes/plugin.php

    r45546 r45583  
    153153        // Translate fields
    154154        if ( $translate ) {
    155                 if ( $textdomain = $plugin_data['TextDomain'] ) {
     155                $textdomain = $plugin_data['TextDomain'];
     156                if ( $textdomain ) {
    156157                        if ( ! is_textdomain_loaded( $textdomain ) ) {
    157158                                if ( $plugin_data['DomainPath'] ) {
    … …  
    365366                return $wp_plugins;
    366367        }
    367         if ( $plugins_dir = @ opendir( WPMU_PLUGIN_DIR ) ) {
     368        $plugins_dir = @opendir( WPMU_PLUGIN_DIR );
     369        if ( $plugins_dir ) {
    368370                while ( ( $file = readdir( $plugins_dir ) ) !== false ) {
    369371                        if ( substr( $file, -4 ) == '.php' ) {
    … …  
    432434
    433435        // These exist in the wp-content directory
    434         if ( $plugins_dir = @ opendir( WP_CONTENT_DIR ) ) {
     436        $plugins_dir = @opendir( WP_CONTENT_DIR );
     437        if ( $plugins_dir ) {
    435438                while ( ( $file = readdir( $plugins_dir ) ) !== false ) {
    436439                        if ( isset( $_dropins[ $file ] ) ) {
    … …  
    734737                $network_current = get_site_option( 'active_sitewide_plugins', array() );
    735738        }
    736         $current = get_option( 'active_plugins', array() );
    737         $do_blog = $do_network = false;
     739        $current    = get_option( 'active_plugins', array() );
     740        $do_blog    = false;
     741        $do_network = false;
    738742
    739743        foreach ( (array) $plugins as $plugin ) {
    … …  
    993997
    994998        // Remove deleted plugins from the plugin updates list.
    995         if ( $current = get_site_transient( 'update_plugins' ) ) {
     999        $current = get_site_transient( 'update_plugins' );
     1000        if ( $current ) {
    9961001                // Don't remove the plugins that weren't deleted.
    9971002                $deleted = array_diff( $plugins, $errors );
    … …  
    18201825        $hook = get_plugin_page_hook( $plugin_page, $pagenow );
    18211826
    1822         $parent = $parent1 = get_admin_page_parent();
     1827        $parent  = get_admin_page_parent();
     1828        $parent1 = $parent;
    18231829
    18241830        if ( empty( $parent ) ) {
  • trunk/src/wp-admin/includes/post.php

    r45424 r45583  
    340340        if ( isset( $post_data['meta'] ) && $post_data['meta'] ) {
    341341                foreach ( $post_data['meta'] as $key => $value ) {
    342                         if ( ! $meta = get_post_meta_by_id( $key ) ) {
     342                        $meta = get_post_meta_by_id( $key );
     343                        if ( ! $meta ) {
    343344                                continue;
    344345                        }
    … …  
    358359        if ( isset( $post_data['deletemeta'] ) && $post_data['deletemeta'] ) {
    359360                foreach ( $post_data['deletemeta'] as $key => $value ) {
    360                         if ( ! $meta = get_post_meta_by_id( $key ) ) {
     361                        $meta = get_post_meta_by_id( $key );
     362                        if ( ! $meta ) {
    361363                                continue;
    362364                        }
    … …  
    532534        }
    533535
    534         if ( isset( $post_data['post_parent'] ) && ( $parent = (int) $post_data['post_parent'] ) ) {
     536        if ( isset( $post_data['post_parent'] ) && (int) $post_data['post_parent'] ) {
     537                $parent   = (int) $post_data['post_parent'];
    535538                $pages    = $wpdb->get_results( "SELECT ID, post_parent FROM $wpdb->posts WHERE post_type = 'page'" );
    536539                $children = array();
    … …  
    548551        }
    549552
    550         $updated          = $skipped = $locked = array();
     553        $updated          = array();
     554        $skipped          = array();
     555        $locked           = array();
    551556        $shared_post_data = $post_data;
    552557
    … …  
    12821287        if ( isset( $_GET['edit'] ) && $_GET['edit'] == $box_id ) {
    12831288                $classes = array( '' );
    1284         } elseif ( $closed = get_user_option( 'closedpostboxes_' . $screen_id ) ) {
     1289        } elseif ( get_user_option( 'closedpostboxes_' . $screen_id ) ) {
     1290                $closed = get_user_option( 'closedpostboxes_' . $screen_id );
    12851291                if ( ! is_array( $closed ) ) {
    12861292                        $classes = array( '' );
    … …  
    15571563 */
    15581564function wp_check_post_lock( $post_id ) {
    1559         if ( ! $post = get_post( $post_id ) ) {
     1565        $post = get_post( $post_id );
     1566        if ( ! $post ) {
    15601567                return false;
    15611568        }
    15621569
    1563         if ( ! $lock = get_post_meta( $post->ID, '_edit_lock', true ) ) {
     1570        $lock = get_post_meta( $post->ID, '_edit_lock', true );
     1571        if ( ! $lock ) {
    15641572                return false;
    15651573        }
    … …  
    15931601 */
    15941602function wp_set_post_lock( $post_id ) {
    1595         if ( ! $post = get_post( $post_id ) ) {
     1603        $post = get_post( $post_id );
     1604        if ( ! $post ) {
    15961605                return false;
    15971606        }
    15981607
    1599         if ( 0 == ( $user_id = get_current_user_id() ) ) {
     1608        $user_id = get_current_user_id();
     1609        if ( 0 == $user_id ) {
    16001610                return false;
    16011611        }
    … …  
    16161626 */
    16171627function _admin_notice_post_locked() {
    1618         if ( ! $post = get_post() ) {
     1628        $post = get_post();
     1629        if ( ! $post ) {
    16191630                return;
    16201631        }
    16211632
    1622         $user = null;
    1623         if ( $user_id = wp_check_post_lock( $post->ID ) ) {
     1633        $user    = null;
     1634        $user_id = wp_check_post_lock( $post->ID );
     1635        if ( $user_id ) {
    16241636                $user = get_userdata( $user_id );
    16251637        }
    … …  
    16471659        }
    16481660
    1649         if ( $locked && ( $sendback = wp_get_referer() ) &&
    1650                 false === strpos( $sendback, 'post.php' ) && false === strpos( $sendback, 'post-new.php' ) ) {
     1661        $sendback = wp_get_referer();
     1662        if ( $locked && $sendback && false === strpos( $sendback, 'post.php' ) && false === strpos( $sendback, 'post-new.php' ) ) {
    16511663
    16521664                $sendback_text = __( 'Go back' );
    … …  
    17941806
    17951807        // Store one autosave per author. If there is already an autosave, overwrite it.
    1796         if ( $old_autosave = wp_get_post_autosave( $post_id, $post_author ) ) {
     1808        $old_autosave = wp_get_post_autosave( $post_id, $post_author );
     1809        if ( $old_autosave ) {
    17971810                $new_autosave                = _wp_post_revision_data( $post_data, true );
    17981811                $new_autosave['ID']          = $old_autosave->ID;
    … …  
    18451858        $_POST['ID'] = $post_ID;
    18461859
    1847         if ( ! $post = get_post( $post_ID ) ) {
     1860        $post = get_post( $post_ID );
     1861        if ( ! $post ) {
    18481862                wp_die( __( 'Sorry, you are not allowed to edit this post.' ) );
    18491863        }
    … …  
    19061920        }
    19071921
    1908         $post_id         = (int) $post_data['post_id'];
    1909         $post_data['ID'] = $post_data['post_ID'] = $post_id;
     1922        $post_id              = (int) $post_data['post_id'];
     1923        $post_data['ID']      = $post_id;
     1924        $post_data['post_ID'] = $post_id;
    19101925
    19111926        if ( false === wp_verify_nonce( $post_data['_wpnonce'], 'update-post_' . $post_id ) ) {
  • trunk/src/wp-admin/includes/revision.php

    r43571 r45583  
    2121 */
    2222function wp_get_revision_ui_diff( $post, $compare_from, $compare_to ) {
    23         if ( ! $post = get_post( $post ) ) {
     23        $post = get_post( $post );
     24        if ( ! $post ) {
    2425                return false;
    2526        }
    2627
    2728        if ( $compare_from ) {
    28                 if ( ! $compare_from = get_post( $compare_from ) ) {
     29                $compare_from = get_post( $compare_from );
     30                if ( ! $compare_from ) {
    2931                        return false;
    3032                }
    … …  
    3436        }
    3537
    36         if ( ! $compare_to = get_post( $compare_to ) ) {
     38        $compare_to = get_post( $compare_to );
     39        if ( ! $compare_to ) {
    3740                return false;
    3841        }
  • trunk/src/wp-admin/includes/taxonomy.php

    r42877 r45583  
    5454 */
    5555function wp_create_category( $cat_name, $parent = 0 ) {
    56         if ( $id = category_exists( $cat_name, $parent ) ) {
     56        $id = category_exists( $cat_name, $parent );
     57        if ( $id ) {
    5758                return $id;
    5859        }
    … …  
    7879        $cat_ids = array();
    7980        foreach ( $categories as $category ) {
    80                 if ( $id = category_exists( $category ) ) {
     81                $id = category_exists( $category );
     82                if ( $id ) {
    8183                        $cat_ids[] = $id;
    82                 } elseif ( $id = wp_create_category( $category ) ) {
    83                         $cat_ids[] = $id;
     84                } else {
     85                        $id = wp_create_category( $category );
     86                        if ( $id ) {
     87                                $cat_ids[] = $id;
     88                        }
    8489                }
    8590        }
    … …  
    301306 */
    302307function wp_create_term( $tag_name, $taxonomy = 'post_tag' ) {
    303         if ( $id = term_exists( $tag_name, $taxonomy ) ) {
     308        $id = term_exists( $tag_name, $taxonomy );
     309        if ( $id ) {
    304310                return $id;
    305311        }
  • trunk/src/wp-admin/includes/template.php

    r45403 r45583  
    12131213
    12141214        // Grab the ones the user has manually sorted. Pull them out of their previous context/priority and into the one the user chose
    1215         if ( ! $already_sorted && $sorted = get_user_option( "meta-box-order_$page" ) ) {
     1215        $sorted = get_user_option( "meta-box-order_$page" );
     1216        if ( ! $already_sorted && $sorted ) {
    12161217                foreach ( $sorted as $box_context => $ids ) {
    12171218                        foreach ( explode( ',', $ids ) as $id ) {
  • trunk/src/wp-admin/includes/theme-install.php

    r44643 r45583  
    6363        _deprecated_function( __FUNCTION__, '3.1.0', 'get_theme_feature_list()' );
    6464
    65         if ( ! $cache = get_transient( 'wporg_theme_feature_list' ) ) {
     65        $cache = get_transient( 'wporg_theme_feature_list' );
     66        if ( ! $cache ) {
    6667                set_transient( 'wporg_theme_feature_list', array(), 3 * HOUR_IN_SECONDS );
    6768        }
  • trunk/src/wp-admin/includes/theme.php

    r45412 r45583  
    304304        }
    305305
    306         if ( ! $feature_list = get_site_transient( 'wporg_theme_feature_list' ) ) {
     306        $feature_list = get_site_transient( 'wporg_theme_feature_list' );
     307        if ( ! $feature_list ) {
    307308                set_site_transient( 'wporg_theme_feature_list', array(), 3 * HOUR_IN_SECONDS );
    308309        }
    … …  
    491492
    492493                $http_url = $url;
    493                 if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
     494                $ssl      = wp_http_supports( array( 'ssl' ) );
     495                if ( $ssl ) {
    494496                        $url = set_url_scheme( $url, 'https' );
    495497                }
  • trunk/src/wp-admin/includes/translation-install.php

    r45412 r45583  
    3636
    3737        if ( false === $res ) {
    38                 $url = $http_url = 'http://api.wordpress.org/translations/' . $type . '/1.0/';
    39                 if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
     38                $url      = 'http://api.wordpress.org/translations/' . $type . '/1.0/';
     39                $http_url = $url;
     40                $ssl      = wp_http_supports( array( 'ssl' ) );
     41                if ( $ssl ) {
    4042                        $url = set_url_scheme( $url, 'https' );
    4143                }
    … …  
    118120 */
    119121function wp_get_available_translations() {
    120         if ( ! wp_installing() && false !== ( $translations = get_site_transient( 'available_translations' ) ) ) {
    121                 return $translations;
     122        if ( ! wp_installing() ) {
     123                $translations = get_site_transient( 'available_translations' );
     124                if ( false !== $translations ) {
     125                        return $translations;
     126                }
    122127        }
    123128
  • trunk/src/wp-admin/includes/update.php

    r45529 r45583  
    117117 */
    118118function get_core_checksums( $version, $locale ) {
    119         $url = $http_url = 'http://api.wordpress.org/core/checksums/1.0/?' . http_build_query( compact( 'version', 'locale' ), null, '&' );
    120 
    121         if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
     119        $http_url = 'http://api.wordpress.org/core/checksums/1.0/?' . http_build_query( compact( 'version', 'locale' ), null, '&' );
     120        $url      = $http_url;
     121
     122        $ssl = wp_http_supports( array( 'ssl' ) );
     123        if ( $ssl ) {
    122124                $url = set_url_scheme( $url, 'https' );
    123125        }
  • trunk/src/wp-admin/includes/upgrade.php

    r45580 r45583  
    12611261
    12621262                // Associate terms with the same slug in a term group and make slugs unique.
    1263                 if ( $exists = $wpdb->get_results( $wpdb->prepare( "SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug ) ) ) {
     1263                $exists = $wpdb->get_results( $wpdb->prepare( "SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug ) );
     1264                if ( $exists ) {
    12641265                        $term_group = $exists[0]->term_group;
    12651266                        $id         = $exists[0]->term_id;
    … …  
    13661367
    13671368                        // Associate terms with the same slug in a term group and make slugs unique.
    1368                         if ( $exists = $wpdb->get_results( $wpdb->prepare( "SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug ) ) ) {
     1369                        $exists = $wpdb->get_results( $wpdb->prepare( "SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug ) );
     1370                        if ( $exists ) {
    13691371                                $term_group = $exists[0]->term_group;
    13701372                                $term_id    = $exists[0]->term_id;
    … …  
    18241826        }
    18251827
    1826         if ( $wp_current_db_version < 22422 && $term = get_term_by( 'slug', 'post-format-standard', 'post_format' ) ) {
    1827                 wp_delete_term( $term->term_id, 'post_format' );
     1828        if ( $wp_current_db_version < 22422 ) {
     1829                $term = get_term_by( 'slug', 'post-format-standard', 'post_format' );
     1830                if ( $term ) {
     1831                        wp_delete_term( $term->term_id, 'post_format' );
     1832                }
    18281833        }
    18291834}
    … …  
    24312436        global $wpdb;
    24322437        $all_options = new stdClass;
    2433         if ( $options = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" ) ) {
     2438        $options     = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" );
     2439        if ( $options ) {
    24342440                foreach ( $options as $option ) {
    24352441                        if ( 'siteurl' == $option->option_name || 'home' == $option->option_name || 'category_base' == $option->option_name ) {
    … …  
    26082614
    26092615                // Clear the field and index arrays.
    2610                 $cfields = $indices = $indices_without_subparts = array();
     2616                $cfields                  = array();
     2617                $indices                  = array();
     2618                $indices_without_subparts = array();
    26112619
    26122620                // Get all of the field names in the query from between the parentheses.
    … …  
    26832691
    26842692                                        // Parse the columns. Multiple columns are separated by a comma.
    2685                                         $index_columns = $index_columns_without_subparts = array_map( 'trim', explode( ',', $index_matches['index_columns'] ) );
     2693                                        $index_columns                  = array_map( 'trim', explode( ',', $index_matches['index_columns'] ) );
     2694                                        $index_columns_without_subparts = $index_columns;
    26862695
    26872696                                        // Normalize columns.
    … …  
    28532862
    28542863                                // Check if the index definition exists, ignoring subparts.
    2855                                 if ( ! ( ( $aindex = array_search( $index_string, $indices_without_subparts ) ) === false ) ) {
     2864                                $aindex = array_search( $index_string, $indices_without_subparts );
     2865                                if ( false !== $aindex ) {
    28562866                                        // If the index already exists (even with different subparts), we don't need to create it.
    28572867                                        unset( $indices_without_subparts[ $aindex ] );
  • trunk/src/wp-admin/includes/user.php

    r45448 r45583  
    4545        }
    4646
    47         $pass1 = $pass2 = '';
     47        $pass1 = '';
     48        $pass2 = '';
    4849        if ( isset( $_POST['pass1'] ) ) {
    4950                $pass1 = $_POST['pass1'];
    … …  
    202203        } elseif ( ! is_email( $user->user_email ) ) {
    203204                $errors->add( 'invalid_email', __( '<strong>ERROR</strong>: The email address isn&#8217;t correct.' ), array( 'form-field' => 'email' ) );
    204         } elseif ( ( $owner_id = email_exists( $user->user_email ) ) && ( ! $update || ( $owner_id != $user->ID ) ) ) {
    205                 $errors->add( 'email_exists', __( '<strong>ERROR</strong>: This email is already registered, please choose another one.' ), array( 'form-field' => 'email' ) );
     205        } else {
     206                $owner_id = email_exists( $user->user_email );
     207                if ( $owner_id && ( ! $update || ( $owner_id != $user->ID ) ) ) {
     208                        $errors->add( 'email_exists', __( '<strong>ERROR</strong>: This email is already registered, please choose another one.' ), array( 'form-field' => 'email' ) );
     209                }
    206210        }
    207211
  • trunk/src/wp-admin/includes/widgets.php

    r43571 r45583  
    300300
    301301        <div class="widget-description">
    302         <?php echo ( $widget_description = wp_widget_description( $widget_id ) ) ? "$widget_description\n" : "$widget_title\n"; ?>
     302        <?php
     303        $widget_description = wp_widget_description( $widget_id );
     304        echo ( $widget_description ) ? "$widget_description\n" : "$widget_title\n";
     305        ?>
    303306        </div>
    304307        <?php
  • trunk/src/wp-admin/install.php

    r45403 r45583  
    308308switch ( $step ) {
    309309        case 0: // Step 0
    310                 if ( wp_can_install_language_pack() && empty( $language ) && ( $languages = wp_get_available_translations() ) ) {
    311                         $scripts_to_print[] = 'language-chooser';
    312                         display_header( 'language-chooser' );
    313                         echo '<form id="setup" method="post" action="?step=1">';
    314                         wp_install_language_form( $languages );
    315                         echo '</form>';
    316                         break;
     310                if ( wp_can_install_language_pack() && empty( $language ) ) {
     311                        $languages = wp_get_available_translations();
     312                        if ( $languages ) {
     313                                $scripts_to_print[] = 'language-chooser';
     314                                display_header( 'language-chooser' );
     315                                echo '<form id="setup" method="post" action="?step=1">';
     316                                wp_install_language_form( $languages );
     317                                echo '</form>';
     318                                break;
     319                        }
    317320                }
    318321
  • trunk/src/wp-admin/link-manager.php

    r45382 r45583  
    4545$wp_list_table->prepare_items();
    4646
    47 $title     = __( 'Links' );
    48 $this_file = $parent_file = 'link-manager.php';
     47$title       = __( 'Links' );
     48$this_file   = 'link-manager.php';
     49$parent_file = $this_file;
    4950
    5051get_current_screen()->add_help_tab(
  • trunk/src/wp-admin/link.php

    r42343 r45583  
    113113                $link_id = (int) $_GET['link_id'];
    114114
    115                 if ( ! $link = get_link_to_edit( $link_id ) ) {
     115                $link = get_link_to_edit( $link_id );
     116                if ( ! $link ) {
    116117                        wp_die( __( 'Link not found.' ) );
    117118                }
  • trunk/src/wp-admin/media.php

    r45437 r45583  
    2828                if ( empty( $errors ) ) {
    2929                        $location = 'media.php';
    30                         if ( $referer = wp_get_original_referer() ) {
     30                        $referer  = wp_get_original_referer();
     31                        if ( $referer ) {
    3132                                if ( false !== strpos( $referer, 'upload.php' ) || ( url_to_postid( $referer ) == $attachment_id ) ) {
    3233                                        $location = $referer;
  • trunk/src/wp-admin/menu-header.php

    r44331 r45583  
    109109                $class     = $class ? ' class="' . join( ' ', $class ) . '"' : '';
    110110                $id        = ! empty( $item[5] ) ? ' id="' . preg_replace( '|[^a-zA-Z0-9_:.]|', '-', $item[5] ) . '"' : '';
    111                 $img       = $img_style = '';
     111                $img       = '';
     112                $img_style = '';
    112113                $img_class = ' dashicons-before';
    113114
    … …  
    153154                        $menu_hook     = get_plugin_page_hook( $submenu_items[0][2], $item[2] );
    154155                        $menu_file     = $submenu_items[0][2];
    155                         if ( false !== ( $pos = strpos( $menu_file, '?' ) ) ) {
     156                        $pos           = strpos( $menu_file, '?' );
     157                        if ( false !== $pos ) {
    156158                                $menu_file = substr( $menu_file, 0, $pos );
    157159                        }
    … …  
    165167                        $menu_hook = get_plugin_page_hook( $item[2], 'admin.php' );
    166168                        $menu_file = $item[2];
    167                         if ( false !== ( $pos = strpos( $menu_file, '?' ) ) ) {
     169                        $pos       = strpos( $menu_file, '?' );
     170                        if ( false !== $pos ) {
    168171                                $menu_file = substr( $menu_file, 0, $pos );
    169172                        }
    … …  
    197200                                $menu_file = $item[2];
    198201
    199                                 if ( false !== ( $pos = strpos( $menu_file, '?' ) ) ) {
     202                                $pos = strpos( $menu_file, '?' );
     203                                if ( false !== $pos ) {
    200204                                        $menu_file = substr( $menu_file, 0, $pos );
    201205                                }
    … …  
    227231                                $menu_hook = get_plugin_page_hook( $sub_item[2], $item[2] );
    228232                                $sub_file  = $sub_item[2];
    229                                 if ( false !== ( $pos = strpos( $sub_file, '?' ) ) ) {
     233                                $pos       = strpos( $sub_file, '?' );
     234                                if ( false !== $pos ) {
    230235                                        $sub_file = substr( $sub_file, 0, $pos );
    231236                                }
  • trunk/src/wp-admin/options-general.php

    r45556 r45583  
    7474<?php
    7575if ( ! is_multisite() ) {
    76         $wp_site_url_class = $wp_home_class = '';
     76        $wp_site_url_class = '';
     77        $wp_home_class     = '';
    7778        if ( defined( 'WP_SITEURL' ) ) {
    7879                $wp_site_url_class = ' disabled';
  • trunk/src/wp-admin/options-permalink.php

    r45424 r45583  
    5858$permalink_structure = get_option( 'permalink_structure' );
    5959
    60 $prefix = $blog_prefix = '';
     60$prefix      = '';
     61$blog_prefix = '';
    6162if ( ! got_url_rewrite() ) {
    6263        $prefix = '/index.php';
  • trunk/src/wp-admin/options.php

    r45439 r45583  
    8181}
    8282
    83 $whitelist_options         = array(
     83$whitelist_options            = array(
    8484        'general'    => array(
    8585                'blogname',
    … …  
    147147        ),
    148148);
    149 $whitelist_options['misc'] = $whitelist_options['options'] = $whitelist_options['privacy'] = array();
     149$whitelist_options['misc']    = array();
     150$whitelist_options['options'] = array();
     151$whitelist_options['privacy'] = array();
    150152
    151153$mail_options = array( 'mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass' );
  • trunk/src/wp-admin/plugins.php

    r45432 r45583  
    292292
    293293                                        if ( '.' == $plugin_slug ) {
    294                                                 if ( $data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ) ) {
     294                                                $data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
     295                                                if ( $data ) {
    295296                                                        $plugin_info[ $plugin ]                     = $data;
    296297                                                        $plugin_info[ $plugin ]['is_uninstallable'] = is_uninstallable_plugin( $plugin );
    … …  
    301302                                        } else {
    302303                                                // Get plugins list from that folder.
    303                                                 if ( $folder_plugins = get_plugins( '/' . $plugin_slug ) ) {
     304                                                $folder_plugins = get_plugins( '/' . $plugin_slug );
     305                                                if ( $folder_plugins ) {
    304306                                                        foreach ( $folder_plugins as $plugin_file => $data ) {
    305307                                                                $plugin_info[ $plugin_file ]                     = _get_plugin_data_markup_translate( $plugin_file, $data );
  • trunk/src/wp-admin/post.php

    r44726 r45583  
    2020        wp_die( __( 'A post ID mismatch has been detected.' ), __( 'Sorry, you are not allowed to edit this item.' ), 400 );
    2121} elseif ( isset( $_GET['post'] ) ) {
    22         $post_id = $post_ID = (int) $_GET['post'];
     22        $post_id = (int) $_GET['post'];
    2323} elseif ( isset( $_POST['post_ID'] ) ) {
    24         $post_id = $post_ID = (int) $_POST['post_ID'];
     24        $post_id = (int) $_POST['post_ID'];
    2525} else {
    26         $post_id = $post_ID = 0;
    27 }
     26        $post_id = 0;
     27}
     28$post_ID = $post_id;
    2829
    2930/**
    … …  
    242243                }
    243244
    244                 if ( $user_id = wp_check_post_lock( $post_id ) ) {
     245                $user_id = wp_check_post_lock( $post_id );
     246                if ( $user_id ) {
    245247                        $user = get_userdata( $user_id );
    246248                        wp_die( sprintf( __( 'You cannot move this item to the Trash. %s is currently editing.' ), $user->display_name ) );
  • trunk/src/wp-admin/revision.php

    r45140 r45583  
    3434switch ( $action ) {
    3535        case 'restore':
    36                 if ( ! $revision = wp_get_post_revision( $revision_id ) ) {
     36                $revision = wp_get_post_revision( $revision_id );
     37                if ( ! $revision ) {
    3738                        break;
    3839                }
    … …  
    4243                }
    4344
    44                 if ( ! $post = get_post( $revision->post_parent ) ) {
     45                $post = get_post( $revision->post_parent );
     46                if ( ! $post ) {
    4547                        break;
    4648                }
    … …  
    7173        case 'edit':
    7274        default:
    73                 if ( ! $revision = wp_get_post_revision( $revision_id ) ) {
     75                $revision = wp_get_post_revision( $revision_id );
     76                if ( ! $revision ) {
    7477                        break;
    7578                }
    76                 if ( ! $post = get_post( $revision->post_parent ) ) {
     79
     80                $post = get_post( $revision->post_parent );
     81                if ( ! $post ) {
    7782                        break;
    7883                }
    … …  
    111116// This is so that the correct "Edit" menu item is selected.
    112117if ( ! empty( $post->post_type ) && 'post' != $post->post_type ) {
    113         $parent_file = $submenu_file = 'edit.php?post_type=' . $post->post_type;
     118        $parent_file = 'edit.php?post_type=' . $post->post_type;
    114119} else {
    115         $parent_file = $submenu_file = 'edit.php';
     120        $parent_file = 'edit.php';
    116121}
     122$submenu_file = $parent_file;
    117123
    118124wp_enqueue_script( 'revisions' );
  • trunk/src/wp-admin/setup-config.php

    r45433 r45583  
    127127switch ( $step ) {
    128128        case -1:
    129                 if ( wp_can_install_language_pack() && empty( $language ) && ( $languages = wp_get_available_translations() ) ) {
    130                         setup_config_display_header( 'language-chooser' );
    131                         echo '<h1 class="screen-reader-text">Select a default language</h1>';
    132                         echo '<form id="setup" method="post" action="?step=0">';
    133                         wp_install_language_form( $languages );
    134                         echo '</form>';
    135                         break;
     129                if ( wp_can_install_language_pack() && empty( $language ) ) {
     130                        $languages = wp_get_available_translations();
     131                        if ( $languages ) {
     132                                setup_config_display_header( 'language-chooser' );
     133                                echo '<h1 class="screen-reader-text">Select a default language</h1>';
     134                                echo '<form id="setup" method="post" action="?step=0">';
     135                                wp_install_language_form( $languages );
     136                                echo '</form>';
     137                                break;
     138                        }
    136139                }
    137140
  • trunk/src/wp-admin/theme-editor.php

    r45431 r45583  
    7474}
    7575
    76 $allowed_files = $style_files = array();
     76$allowed_files = array();
     77$style_files   = array();
    7778$has_templates = false;
    7879
  • trunk/src/wp-admin/themes.php

    r45140 r45583  
    269269                        }
    270270
    271                         if ( false !== ( $pos = strpos( $menu_file, '?' ) ) ) {
     271                        $pos = strpos( $menu_file, '?' );
     272                        if ( false !== $pos ) {
    272273                                $menu_file = substr( $menu_file, 0, $pos );
    273274                        }
    … …  
    369370<?php
    370371// List broken themes, if any.
    371 if ( ! is_multisite() && current_user_can( 'edit_themes' ) && $broken_themes = wp_get_themes( array( 'errors' => true ) ) ) {
     372$broken_themes = wp_get_themes( array( 'errors' => true ) );
     373if ( ! is_multisite() && current_user_can( 'edit_themes' ) && $broken_themes ) {
    372374        ?>
    373375
  • trunk/src/wp-admin/update-core.php

    r45532 r45583  
    3636        static $first_pass = true;
    3737
    38         $wp_version = get_bloginfo( 'version' );
     38        $wp_version     = get_bloginfo( 'version' );
     39        $version_string = sprintf( '%s&ndash;<strong>%s</strong>', $update->current, $update->locale );
    3940
    4041        if ( 'en_US' == $update->locale && 'en_US' == get_locale() ) {
    4142                $version_string = $update->current;
    42         } elseif ( 'en_US' == $update->locale && $update->packages->partial && $wp_version == $update->partial_version && ( $updates = get_core_updates() ) && 1 == count( $updates ) ) {
    43                 // If the only available update is a partial builds, it doesn't need a language-specific version string.
    44                 $version_string = $update->current;
    45         } else {
    46                 $version_string = sprintf( '%s&ndash;<strong>%s</strong>', $update->current, $update->locale );
     43        } elseif ( 'en_US' == $update->locale && $update->packages->partial && $wp_version == $update->partial_version ) {
     44                $updates = get_core_updates();
     45                if ( $updates && 1 == count( $updates ) ) {
     46                        // If the only available update is a partial builds, it doesn't need a language-specific version string.
     47                        $version_string = $update->current;
     48                }
    4749        }
    4850
    … …  
    538540        <?php
    539541
    540         if ( false === ( $credentials = request_filesystem_credentials( $url, '', false, ABSPATH, array( 'version', 'locale' ), $allow_relaxed_file_ownership ) ) ) {
     542        $credentials = request_filesystem_credentials( $url, '', false, ABSPATH, array( 'version', 'locale' ), $allow_relaxed_file_ownership );
     543        if ( false === $credentials ) {
    541544                echo '</div>';
    542545                return;
  • trunk/src/wp-admin/upload.php

    r45140 r45583  
    131131
    132132        $location = 'upload.php';
    133         if ( $referer = wp_get_referer() ) {
     133        $referer  = wp_get_referer();
     134        if ( $referer ) {
    134135                if ( false !== strpos( $referer, 'upload.php' ) ) {
    135136                        $location = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'message', 'ids', 'posted' ), $referer );
    … …  
    287288}
    288289
    289 if ( ! empty( $_GET['attached'] ) && $attached = absint( $_GET['attached'] ) ) {
     290if ( ! empty( $_GET['attached'] ) && absint( $_GET['attached'] ) ) {
     291        $attached = absint( $_GET['attached'] );
    290292        if ( 1 == $attached ) {
    291293                $message = __( 'Media file attached.' );
    … …  
    298300}
    299301
    300 if ( ! empty( $_GET['detach'] ) && $detached = absint( $_GET['detach'] ) ) {
     302if ( ! empty( $_GET['detach'] ) && absint( $_GET['detach'] ) ) {
     303        $detached = absint( $_GET['detach'] );
    301304        if ( 1 == $detached ) {
    302305                $message = __( 'Media file detached.' );
    … …  
    309312}
    310313
    311 if ( ! empty( $_GET['deleted'] ) && $deleted = absint( $_GET['deleted'] ) ) {
     314if ( ! empty( $_GET['deleted'] ) && absint( $_GET['deleted'] ) ) {
     315        $deleted = absint( $_GET['deleted'] );
    312316        if ( 1 == $deleted ) {
    313317                $message = __( 'Media file permanently deleted.' );
    … …  
    320324}
    321325
    322 if ( ! empty( $_GET['trashed'] ) && $trashed = absint( $_GET['trashed'] ) ) {
     326if ( ! empty( $_GET['trashed'] ) && absint( $_GET['trashed'] ) ) {
     327        $trashed = absint( $_GET['trashed'] );
    323328        if ( 1 == $trashed ) {
    324329                $message = __( 'Media file moved to the trash.' );
    … …  
    332337}
    333338
    334 if ( ! empty( $_GET['untrashed'] ) && $untrashed = absint( $_GET['untrashed'] ) ) {
     339if ( ! empty( $_GET['untrashed'] ) && absint( $_GET['untrashed'] ) ) {
     340        $untrashed = absint( $_GET['untrashed'] );
    335341        if ( 1 == $untrashed ) {
    336342                $message = __( 'Media file restored from the trash.' );
  • trunk/src/wp-admin/user-edit.php

    r45416 r45583  
    603603                 * @param WP_User $profileuser User object for the current user to edit.
    604604                 */
    605                 if ( $show_password_fields = apply_filters( 'show_password_fields', true, $profileuser ) ) :
     605                $show_password_fields = apply_filters( 'show_password_fields', true, $profileuser );
     606                if ( $show_password_fields ) :
    606607                        ?>
    607608        </table>
  • trunk/src/wp-admin/users.php

    r45542 r45583  
    486486                                        $message = __( 'New user created.' );
    487487
    488                                         if ( isset( $_GET['id'] ) && ( $user_id = $_GET['id'] ) && current_user_can( 'edit_user', $user_id ) ) {
     488                                        $user_id = isset( $_GET['id'] ) ? $_GET['id'] : false;
     489                                        if ( $user_id && current_user_can( 'edit_user', $user_id ) ) {
    489490                                                $message .= sprintf(
    490491                                                        ' <a href="%s">%s</a>',
  • trunk/src/wp-admin/widgets.php

    r45140 r45583  
    255255                                        $multi_number                                    = (int) $_GET['num'];
    256256                                        $control['params'][0]['number']                  = -1;
    257                                         $widget_id                                       = $control['id'] = $control['id_base'] . '-' . $multi_number;
     257                                        $control['id']                                   = $control['id_base'] . '-' . $multi_number;
     258                                        $widget_id                                       = $control['id'];
    258259                                        $wp_registered_widget_controls[ $control['id'] ] = $control;
    259260                                        break;
    … …  
    499500<?php
    500501
    501 $i                    = $split = 0;
     502$i                    = 0;
     503$split                = 0;
    502504$single_sidebar_class = '';
    503505$sidebars_count       = count( $theme_sidebars );
Note: See TracChangeset for help on using the changeset viewer.