Changeset 57943
- Timestamp:
- 04/07/2024 11:51:57 PM (6 months ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/load-scripts.php
r52356 r57943 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 $ver = $wp_scripts->registered[ $handle ]->ver ? $wp_scripts->registered[ $handle ]->ver : $wp_version; 56 $etag .= "{$handle}:{$ver};"; 57 } 58 59 /* 60 * This is not intended to be cryptographically secure, just a fast way to get 61 * a fixed length string based on the script versions. As this file does not 62 * load the full WordPress environment, it is not possible to use the salted 63 * wp_hash() function. 64 */ 65 $etag = 'W/"' . md5( $etag ) . '"'; 66 67 if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $etag ) { 49 68 header( "$protocol 304 Not Modified" ); 50 69 exit; … … 60 79 } 61 80 62 header( "Etag: $ wp_version" );81 header( "Etag: $etag" ); 63 82 header( 'Content-Type: application/javascript; charset=UTF-8' ); 64 83 header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' ); -
trunk/src/wp-admin/load-styles.php
r55994 r57943 49 49 wp_default_styles( $wp_styles ); 50 50 51 if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $wp_version ) { 51 $etag = "WP:{$wp_version};"; 52 53 foreach ( $load as $handle ) { 54 if ( ! array_key_exists( $handle, $wp_styles->registered ) ) { 55 continue; 56 } 57 58 $ver = $wp_styles->registered[ $handle ]->ver ? $wp_styles->registered[ $handle ]->ver : $wp_version; 59 $etag .= "{$handle}:{$ver};"; 60 } 61 62 /* 63 * This is not intended to be cryptographically secure, just a fast way to get 64 * a fixed length string based on the script versions. As this file does not 65 * load the full WordPress environment, it is not possible to use the salted 66 * wp_hash() function. 67 */ 68 $etag = 'W/"' . md5( $etag ) . '"'; 69 70 if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $etag ) { 52 71 header( "$protocol 304 Not Modified" ); 53 72 exit; … … 85 104 } 86 105 87 header( "Etag: $ wp_version" );106 header( "Etag: $etag" ); 88 107 header( 'Content-Type: text/css; charset=UTF-8' ); 89 108 header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' );
Note: See TracChangeset
for help on using the changeset viewer.