From 618c5b43336af43efc72c7d67df492464d22ba8e Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 3 Jan 2015 02:57:21 +0000 Subject: [PATCH] When outputting JS with a `Content-Type` header: `text/javascript` is obsolete, `application/x-javascript` was experimental. `application/javascript` is the recommended type per RFC 4329. Props sergej.mueller. Fixes #29196. Built from https://develop.svn.wordpress.org/trunk@31029 git-svn-id: http://core.svn.wordpress.org/trunk@31010 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/ajax-actions.php | 2 +- wp-admin/load-scripts.php | 2 +- wp-includes/js/tinymce/wp-tinymce.php | 2 +- wp-includes/version.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 16fcaa168e..86b453f8f9 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -172,7 +172,7 @@ function wp_ajax_wp_compression_test() { header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); header( 'Cache-Control: no-cache, must-revalidate, max-age=0' ); header( 'Pragma: no-cache' ); - header('Content-Type: application/x-javascript; charset=UTF-8'); + header('Content-Type: application/javascript; charset=UTF-8'); $force_gzip = ( defined('ENFORCE_GZIP') && ENFORCE_GZIP ); $test_str = '"wpCompressionTest Lorem ipsum dolor sit amet consectetuer mollis sapien urna ut a. Eu nonummy condimentum fringilla tempor pretium platea vel nibh netus Maecenas. Hac molestie amet justo quis pellentesque est ultrices interdum nibh Morbi. Cras mattis pretium Phasellus ante ipsum ipsum ut sociis Suspendisse Lorem. Ante et non molestie. Porta urna Vestibulum egestas id congue nibh eu risus gravida sit. Ac augue auctor Ut et non a elit massa id sodales. Elit eu Nulla at nibh adipiscing mattis lacus mauris at tempus. Netus nibh quis suscipit nec feugiat eget sed lorem et urna. Pellentesque lacus at ut massa consectetuer ligula ut auctor semper Pellentesque. Ut metus massa nibh quam Curabitur molestie nec mauris congue. Volutpat molestie elit justo facilisis neque ac risus Ut nascetur tristique. Vitae sit lorem tellus et quis Phasellus lacus tincidunt nunc Fusce. Pharetra wisi Suspendisse mus sagittis libero lacinia Integer consequat ac Phasellus. Et urna ac cursus tortor aliquam Aliquam amet tellus volutpat Vestibulum. Justo interdum condimentum In augue congue tellus sollicitudin Quisque quis nibh."'; diff --git a/wp-admin/load-scripts.php b/wp-admin/load-scripts.php index 81c4fc6162..d6ff5ad5a8 100644 --- a/wp-admin/load-scripts.php +++ b/wp-admin/load-scripts.php @@ -143,7 +143,7 @@ foreach( $load as $handle ) { $out .= get_file($path) . "\n"; } -header('Content-Type: application/x-javascript; charset=UTF-8'); +header('Content-Type: application/javascript; charset=UTF-8'); header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT'); header("Cache-Control: public, max-age=$expires_offset"); diff --git a/wp-includes/js/tinymce/wp-tinymce.php b/wp-includes/js/tinymce/wp-tinymce.php index 922df9fc15..ea58e682d0 100644 --- a/wp-includes/js/tinymce/wp-tinymce.php +++ b/wp-includes/js/tinymce/wp-tinymce.php @@ -21,7 +21,7 @@ function get_file($path) { $expires_offset = 31536000; // 1 year -header('Content-Type: application/x-javascript; charset=UTF-8'); +header('Content-Type: application/javascript; charset=UTF-8'); header('Vary: Accept-Encoding'); // Handle proxies header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT'); header("Cache-Control: public, max-age=$expires_offset"); diff --git a/wp-includes/version.php b/wp-includes/version.php index 37ca50045b..60fa371c03 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31028'; +$wp_version = '4.2-alpha-31029'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.