Make WordPress Core

Changeset 31029


Ignore:
Timestamp:
01/03/2015 02:56:14 AM (9 years ago)
Author:
wonderboymusic
Message:

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.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r31016 r31029  
    173173        header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
    174174        header( 'Pragma: no-cache' );
    175         header('Content-Type: application/x-javascript; charset=UTF-8');
     175        header('Content-Type: application/javascript; charset=UTF-8');
    176176        $force_gzip = ( defined('ENFORCE_GZIP') && ENFORCE_GZIP );
    177177        $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."';
  • trunk/src/wp-admin/load-scripts.php

    r29015 r31029  
    144144}
    145145
    146 header('Content-Type: application/x-javascript; charset=UTF-8');
     146header('Content-Type: application/javascript; charset=UTF-8');
    147147header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
    148148header("Cache-Control: public, max-age=$expires_offset");
  • trunk/src/wp-includes/js/tinymce/wp-tinymce.php

    r29015 r31029  
    2222$expires_offset = 31536000; // 1 year
    2323
    24 header('Content-Type: application/x-javascript; charset=UTF-8');
     24header('Content-Type: application/javascript; charset=UTF-8');
    2525header('Vary: Accept-Encoding'); // Handle proxies
    2626header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
Note: See TracChangeset for help on using the changeset viewer.