Make WordPress Core


Ignore:
Timestamp:
05/28/2019 02:42:24 AM (5 years ago)
Author:
azaozz
Message:

Script loader: prevent sorting of the load array in the query string when passing the script handles to load-scripts.php and load-styles.php.

Fixes #45346 #26886.

File:
1 edited

Legend:

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

    r45448 r45456  
    24622462
    24632463        $concat = str_split( $concat, 128 );
    2464         $concat = 'load%5B%5D=' . implode( '&load%5B%5D=', $concat );
    2465 
    2466         $src = $wp_scripts->base_url . "/wp-admin/load-scripts.php?c={$zip}&" . $concat . '&ver=' . $wp_scripts->default_version;
     2464        $concatenated = '';
     2465
     2466        foreach ( $concat as $key => $chunk ) {
     2467            $concatenated .= "&load%5Bchunk_{$key}%5D={$chunk}";
     2468        }
     2469
     2470        $src = $wp_scripts->base_url . "/wp-admin/load-scripts.php?c={$zip}" . $concatenated . '&ver=' . $wp_scripts->default_version;
    24672471        echo "<script type='text/javascript' src='" . esc_attr( $src ) . "'></script>\n";
    24682472    }
     
    26322636
    26332637        $concat = str_split( $concat, 128 );
    2634         $concat = 'load%5B%5D=' . implode( '&load%5B%5D=', $concat );
    2635 
    2636         $href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&dir={$dir}&" . $concat . '&ver=' . $ver;
     2638        $concatenated = '';
     2639
     2640        foreach ( $concat as $key => $chunk ) {
     2641            $concatenated .= "&load%5Bchunk_{$key}%5D={$chunk}";
     2642        }
     2643
     2644        $href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&dir={$dir}" . $concatenated . '&ver=' . $ver;
    26372645        echo "<link rel='stylesheet' href='" . esc_attr( $href ) . "' type='text/css' media='all' />\n";
    26382646
Note: See TracChangeset for help on using the changeset viewer.