Make WordPress Core

Changeset 45457


Ignore:
Timestamp:
05/28/2019 03:31:55 AM (5 years ago)
Author:
azaozz
Message:

Fix previous WPCS errors in script-loader.php triggered by [45456].

See #45346.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r45456 r45457  
    5050
    5151    $compressed = $compress_scripts && $concatenate_scripts && isset( $_SERVER['HTTP_ACCEPT_ENCODING'] )
    52                   && false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) && ! $force_uncompressed;
     52        && false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) && ! $force_uncompressed;
    5353
    5454    // Load tinymce.js when running from /src, otherwise load wp-tinymce.js.gz (in production) or
     
    755755            continue;
    756756        } elseif ( ! empty( $value ) && is_string( $value ) && (
    757             ( '{' == $value{0} && '}' == $value{strlen( $value ) - 1} ) ||
    758             ( '[' == $value{0} && ']' == $value{strlen( $value ) - 1} ) ||
     757            ( '{' === $value{0} && '}' === $value{strlen( $value ) - 1} ) ||
     758            ( '[' === $value{0} && ']' === $value{strlen( $value ) - 1} ) ||
    759759            preg_match( '/^\(?function ?\(/', $value ) ) ) {
    760760            $init_obj .= $key . ':' . $value . ',';
     
    845845    $suffix     = wp_scripts_get_suffix();
    846846    $dev_suffix = wp_scripts_get_suffix( 'dev' );
    847 
    848     if ( ! $guessurl = site_url() ) {
     847    $guessurl   = site_url();
     848
     849    if ( ! $guessurl ) {
    849850        $guessed_url = true;
    850851        $guessurl    = wp_guess_url();
     
    14701471            'themeInstallUnavailable' => sprintf(
    14711472                /* translators: %s: URL to Add Themes admin screen */
    1472                    __( 'You won&#8217;t be able to install new themes from here yet since your install requires SFTP credentials. For now, please <a href="%s">add themes in the admin</a>.' ),
     1473                __( 'You won&#8217;t be able to install new themes from here yet since your install requires SFTP credentials. For now, please <a href="%s">add themes in the admin</a>.' ),
    14731474                esc_url( admin_url( 'theme-install.php' ) )
    14741475            ),
     
    18841885    }
    18851886
    1886     if ( ! $guessurl = site_url() ) {
     1887    $guessurl = site_url();
     1888
     1889    if ( ! $guessurl ) {
    18871890        $guessurl = wp_guess_url();
    18881891    }
     
    19081911        $subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)' );
    19091912
    1910         if ( 'cyrillic' == $subset ) {
     1913        if ( 'cyrillic' === $subset ) {
    19111914            $subsets .= ',cyrillic,cyrillic-ext';
    1912         } elseif ( 'greek' == $subset ) {
     1915        } elseif ( 'greek' === $subset ) {
    19131916            $subsets .= ',greek,greek-ext';
    1914         } elseif ( 'vietnamese' == $subset ) {
     1917        } elseif ( 'vietnamese' === $subset ) {
    19151918            $subsets .= ',vietnamese';
    19161919        }
     
    21112114 */
    21122115function wp_prototype_before_jquery( $js_array ) {
    2113     if ( false === $prototype = array_search( 'prototype', $js_array, true ) ) {
     2116    $prototype = array_search( 'prototype', $js_array, true );
     2117
     2118    if ( false === $prototype ) {
    21142119        return $js_array;
    21152120    }
    21162121
    2117     if ( false === $jquery = array_search( 'jquery', $js_array, true ) ) {
     2122    $jquery = array_search( 'jquery', $js_array, true );
     2123
     2124    if ( false === $jquery ) {
    21182125        return $js_array;
    21192126    }
     
    23312338    }
    23322339
    2333     if ( 'colors' == $handle ) {
     2340    if ( 'colors' === $handle ) {
    23342341        $color = get_user_option( 'admin_color' );
    23352342
     
    24512458    }
    24522459
    2453     if ( $concat = trim( $wp_scripts->concat, ', ' ) ) {
    2454 
     2460    $concat = trim( $wp_scripts->concat, ', ' );
     2461
     2462    if ( $concat ) {
    24552463        if ( ! empty( $wp_scripts->print_code ) ) {
    24562464            echo "\n<script type='text/javascript'>\n";
     
    24612469        }
    24622470
    2463         $concat = str_split( $concat, 128 );
     2471        $concat       = str_split( $concat, 128 );
    24642472        $concatenated = '';
    24652473
     
    26312639    }
    26322640
    2633     if ( $concat = trim( $wp_styles->concat, ', ' ) ) {
     2641    $concat = trim( $wp_styles->concat, ', ' );
     2642
     2643    if ( $concat ) {
    26342644        $dir = $wp_styles->text_direction;
    26352645        $ver = $wp_styles->default_version;
    26362646
    2637         $concat = str_split( $concat, 128 );
     2647        $concat       = str_split( $concat, 128 );
    26382648        $concatenated = '';
    26392649
     
    26692679    global $concatenate_scripts, $compress_scripts, $compress_css;
    26702680
    2671     $compressed_output = ( ini_get( 'zlib.output_compression' ) || 'ob_gzhandler' == ini_get( 'output_handler' ) );
     2681    $compressed_output = ( ini_get( 'zlib.output_compression' ) || 'ob_gzhandler' === ini_get( 'output_handler' ) );
    26722682
    26732683    if ( ! isset( $concatenate_scripts ) ) {
     
    27242734     * @since 5.0.0
    27252735     */
    2726       do_action( 'enqueue_block_assets' );
     2736    do_action( 'enqueue_block_assets' );
    27272737}
    27282738
Note: See TracChangeset for help on using the changeset viewer.