wp/wp-includes/js/tinymce/wp-tinymce.php
changeset 5 5e2f62d02dcd
parent 0 d970ebf37754
child 9 177826044cd9
equal deleted inserted replaced
4:346c88efed21 5:5e2f62d02dcd
     1 <?php
     1 <?php
     2 /**
     2 /**
     3  * Disable error reporting
     3  * Disable error reporting
     4  *
     4  *
     5  * Set this to error_reporting( E_ALL ) or error_reporting( E_ALL | E_STRICT ) for debugging
     5  * Set this to error_reporting( -1 ) for debugging.
     6  */
     6  */
     7 error_reporting(0);
     7 error_reporting(0);
     8 
     8 
     9 $basepath = dirname(__FILE__);
     9 $basepath = dirname(__FILE__);
    10 
    10 
    19 	return @file_get_contents($path);
    19 	return @file_get_contents($path);
    20 }
    20 }
    21 
    21 
    22 $expires_offset = 31536000; // 1 year
    22 $expires_offset = 31536000; // 1 year
    23 
    23 
    24 header('Content-Type: application/x-javascript; charset=UTF-8');
    24 header('Content-Type: application/javascript; charset=UTF-8');
    25 header('Vary: Accept-Encoding'); // Handle proxies
    25 header('Vary: Accept-Encoding'); // Handle proxies
    26 header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
    26 header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
    27 header("Cache-Control: public, max-age=$expires_offset");
    27 header("Cache-Control: public, max-age=$expires_offset");
    28 
    28 
    29 if ( isset($_GET['c']) && 1 == $_GET['c'] && isset($_SERVER['HTTP_ACCEPT_ENCODING'])
    29 if ( isset($_GET['c']) && 1 == $_GET['c'] && isset($_SERVER['HTTP_ACCEPT_ENCODING'])
    30 	&& false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') ) ) {
    30 	&& false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') ) ) {
    31 
    31 
    32 	header('Content-Encoding: gzip');
    32 	header('Content-Encoding: gzip');
    33 	echo $file;
    33 	echo $file;
    34 } else {
    34 } else {
    35 	echo get_file($basepath . '/tiny_mce.js');
    35 	// Back compat. This file shouldn't be used if this condition can occur (as in, if gzip isn't accepted).
    36 	echo get_file($basepath . '/wp-tinymce-schema.js');
    36 	echo get_file( $basepath . '/tinymce.min.js' );
       
    37 	echo get_file( $basepath . '/plugins/compat3x/plugin.min.js' );
    37 }
    38 }
    38 exit;
    39 exit;