diff --git a/src/wp-admin/load-scripts.php b/src/wp-admin/load-scripts.php
index 5675b86570..d761cf4f72 100644
a
|
b
|
wp_default_scripts( $wp_scripts ); |
45 | 45 | wp_default_packages_vendor( $wp_scripts ); |
46 | 46 | wp_default_packages_scripts( $wp_scripts ); |
47 | 47 | |
48 | | if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $wp_version ) { |
| 48 | $etag = "WP:{$wp_version};"; |
| 49 | |
| 50 | foreach ( $load as $handle ) { |
| 51 | if ( ! array_key_exists( $handle, $wp_scripts->registered ) ) { |
| 52 | continue; |
| 53 | } |
| 54 | |
| 55 | $etag .= "{$handle}:{$wp_scripts->registered[ $handle ]->ver};"; |
| 56 | } |
| 57 | |
| 58 | /* |
| 59 | * This is not intended to be cryptographically secure, just a fast way to get |
| 60 | * a fixed length string based on the script versions. As this file does not |
| 61 | * load the WordPress full WordPress environment, it is not possible to use |
| 62 | * the salted wp_hash() function. |
| 63 | */ |
| 64 | $etag = md5( $etag ); |
| 65 | |
| 66 | if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $etag ) { |
49 | 67 | header( "$protocol 304 Not Modified" ); |
50 | 68 | exit; |
51 | 69 | } |
… |
… |
foreach ( $load as $handle ) { |
59 | 77 | $out .= get_file( $path ) . "\n"; |
60 | 78 | } |
61 | 79 | |
62 | | header( "Etag: $wp_version" ); |
| 80 | header( "Etag: $etag" ); |
63 | 81 | header( 'Content-Type: application/javascript; charset=UTF-8' ); |
64 | 82 | header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' ); |
65 | 83 | header( "Cache-Control: public, max-age=$expires_offset" ); |