Make WordPress Core

Ticket #22757: 22757.2.diff

File 22757.2.diff, 1.5 KB (added by nacin, 12 years ago)
  • wp-includes/script-loader.php

     
    689689        if ( $zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP )
    690690                $zip = 'gzip';
    691691
    692         if ( !empty($wp_scripts->concat) ) {
     692        if ( $concat = trim( $wp_scripts->concat, ', ' ) ) {
    693693
    694694                if ( !empty($wp_scripts->print_code) ) {
    695695                        echo "\n<script type='text/javascript'>\n";
     
    699699                        echo "</script>\n";
    700700                }
    701701
    702                 $src = $wp_scripts->base_url . "/wp-admin/load-scripts.php?c={$zip}&load=" . trim($wp_scripts->concat, ', ') . '&ver=' . $wp_scripts->default_version;
     702                $concat = str_split( $concat, 128 );
     703                $concat = 'load[]=' . implode( '&load[]=', $concat );
     704
     705                $src = $wp_scripts->base_url . "/wp-admin/load-scripts.php?c={$zip}&" . $concat . '&ver=' . $wp_scripts->default_version;
    703706                echo "<script type='text/javascript' src='" . esc_attr($src) . "'></script>\n";
    704707        }
    705708
  • wp-admin/load-scripts.php

     
    114114        return @file_get_contents($path);
    115115}
    116116
    117 $load = preg_replace( '/[^a-z0-9,_-]+/i', '', $_GET['load'] );
     117$load = $_GET['load'];
     118if ( is_array( $load ) )
     119        $load = implode( '', $load );
     120
     121$load = preg_replace( '/[^a-z0-9,_-]+/i', '', $load );
    118122$load = explode(',', $load);
    119123
    120124if ( empty($load) )