WordPress.org

Make WordPress Core

Ticket #45346: 45346.diff

File 45346.diff, 2.2 KB (added by azaozz, 15 months ago)
  • src/wp-admin/load-scripts.php

     
    1616
    1717$load = $_GET['load'];
    1818if ( is_array( $load ) ) {
     19        ksort( $load );
    1920        $load = implode( '', $load );
    2021}
    2122
  • src/wp-admin/load-styles.php

     
    2020
    2121$load = $_GET['load'];
    2222if ( is_array( $load ) ) {
     23        ksort( $load );
    2324        $load = implode( '', $load );
    2425}
     26
    2527$load = preg_replace( '/[^a-z0-9,_-]+/i', '', $load );
    2628$load = array_unique( explode( ',', $load ) );
    2729
  • src/wp-includes/script-loader.php

     
    24592459                }
    24602460
    24612461                $concat = str_split( $concat, 128 );
    2462                 $concat = 'load%5B%5D=' . implode( '&load%5B%5D=', $concat );
     2462                $concatenated = '';
    24632463
    2464                 $src = $wp_scripts->base_url . "/wp-admin/load-scripts.php?c={$zip}&" . $concat . '&ver=' . $wp_scripts->default_version;
     2464                foreach ( $concat as $key => $chunk ) {
     2465                        $concatenated .= "&load%5Bchunk_{$key}%5D={$chunk}";
     2466                }
     2467
     2468                $src = $wp_scripts->base_url . "/wp-admin/load-scripts.php?c={$zip}" . $concatenated . '&ver=' . $wp_scripts->default_version;
    24652469                echo "<script type='text/javascript' src='" . esc_attr( $src ) . "'></script>\n";
    24662470        }
    24672471
     
    26292633                $ver = $wp_styles->default_version;
    26302634
    26312635                $concat = str_split( $concat, 128 );
    2632                 $concat = 'load%5B%5D=' . implode( '&load%5B%5D=', $concat );
     2636                $concatenated = '';
    26332637
    2634                 $href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&dir={$dir}&" . $concat . '&ver=' . $ver;
     2638                foreach ( $concat as $key => $chunk ) {
     2639                        $concatenated .= "&load%5Bchunk_{$key}%5D={$chunk}";
     2640                }
     2641
     2642                $href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&dir={$dir}" . $concatenated . '&ver=' . $ver;
    26352643                echo "<link rel='stylesheet' href='" . esc_attr( $href ) . "' type='text/css' media='all' />\n";
    26362644
    26372645                if ( ! empty( $wp_styles->print_code ) ) {