Make WordPress Core

Ticket #54728: 54728.2.diff

File 54728.2.diff, 3.3 KB (added by azouamauriac, 3 years ago)

src/wp-admin/includes/misc.php WordPress.NamingConventions.ValidVariableName and WordPress.PHP.StrictComparisons.LooseComparison

  • src/wp-admin/includes/misc.php

     
    597597                        continue;
    598598                }
    599599
    600                 if ( T_STRING == $tokens[ $t ][0] && ( '(' === $tokens[ $t + 1 ] || '(' === $tokens[ $t + 2 ] ) ) {
     600                if ( T_STRING === $tokens[ $t ][0] && ( '(' === $tokens[ $t + 1 ] || '(' === $tokens[ $t + 2 ] ) ) {
    601601                        // If it's a function or class defined locally, there's not going to be any docs available.
    602602                        if ( ( isset( $tokens[ $t - 2 ][1] ) && in_array( $tokens[ $t - 2 ][1], array( 'function', 'class' ), true ) )
    603                                 || ( isset( $tokens[ $t - 2 ][0] ) && T_OBJECT_OPERATOR == $tokens[ $t - 1 ][0] )
     603                                || ( isset( $tokens[ $t - 2 ][0] ) && T_OBJECT_OPERATOR === $tokens[ $t - 1 ][0] )
    604604                        ) {
    605605                                $ignore_functions[] = $tokens[ $t ][1];
    606606                        }
     
    651651                $option = $_POST['wp_screen_options']['option'];
    652652                $value  = $_POST['wp_screen_options']['value'];
    653653
    654                 if ( sanitize_key( $option ) != $option ) {
     654                if ( sanitize_key( $option ) !== $option ) {
    655655                        return;
    656656                }
    657657
     
    771771        }
    772772        $xpath = new DOMXPath( $doc );
    773773        $rules = $xpath->query( '/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'WordPress\')]' );
    774         if ( 0 == $rules->length ) {
     774        if ( 0 === $rules->length ) {
    775775                return false;
    776776        } else {
    777777                return true;
     
    867867
    868868                        $xmlnodes = $xpath->query( '/configuration/system.webServer' );
    869869                        if ( $xmlnodes->length > 0 ) {
    870                                 $system_webServer_node = $xmlnodes->item( 0 );
    871                                 $system_webServer_node->appendChild( $rewrite_node );
     870                                $system_web_server_node = $xmlnodes->item( 0 );
     871                                $system_web_server_node->appendChild( $rewrite_node );
    872872                        } else {
    873                                 $system_webServer_node = $doc->createElement( 'system.webServer' );
    874                                 $system_webServer_node->appendChild( $rewrite_node );
     873                                $system_web_server_node = $doc->createElement( 'system.webServer' );
     874                                $system_web_server_node->appendChild( $rewrite_node );
    875875
    876876                                $xmlnodes = $xpath->query( '/configuration' );
    877877                                if ( $xmlnodes->length > 0 ) {
    878878                                        $config_node = $xmlnodes->item( 0 );
    879                                         $config_node->appendChild( $system_webServer_node );
     879                                        $config_node->appendChild( $system_web_server_node );
    880880                                } else {
    881881                                        $config_node = $doc->createElement( 'configuration' );
    882882                                        $doc->appendChild( $config_node );
    883                                         $config_node->appendChild( $system_webServer_node );
     883                                        $config_node->appendChild( $system_web_server_node );
    884884                                }
    885885                        }
    886886                }
     
    955955                foreach ( $_wp_admin_css_colors as $color => $color_info ) :
    956956
    957957                        ?>
    958                         <div class="color-option <?php echo ( $color == $current_color ) ? 'selected' : ''; ?>">
     958                        <div class="color-option <?php echo ( $color === $current_color ) ? 'selected' : ''; ?>">
    959959                                <input name="admin_color" id="admin_color_<?php echo esc_attr( $color ); ?>" type="radio" value="<?php echo esc_attr( $color ); ?>" class="tog" <?php checked( $color, $current_color ); ?> />
    960960                                <input type="hidden" class="css_url" value="<?php echo esc_url( $color_info->url ); ?>" />
    961961                                <input type="hidden" class="icon_colors" value="<?php echo esc_attr( wp_json_encode( array( 'icons' => $color_info->icon_colors ) ) ); ?>" />