Changeset 42343 for trunk/src/wp-includes/js/tinymce/wp-tinymce.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/tinymce/wp-tinymce.php
r31029 r42343 5 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 11 function get_file( $path) {11 function get_file( $path ) { 12 12 13 if ( function_exists('realpath') ) 14 $path = realpath($path); 13 if ( function_exists( 'realpath' ) ) { 14 $path = realpath( $path ); 15 } 15 16 16 if ( ! $path || ! @is_file( $path) )17 if ( ! $path || ! @is_file( $path ) ) { 17 18 return false; 19 } 18 20 19 return @file_get_contents( $path);21 return @file_get_contents( $path ); 20 22 } 21 23 22 24 $expires_offset = 31536000; // 1 year 23 25 24 header( 'Content-Type: application/javascript; charset=UTF-8');25 header( 'Vary: Accept-Encoding'); // Handle proxies26 header( 'Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');27 header( "Cache-Control: public, max-age=$expires_offset");26 header( 'Content-Type: application/javascript; charset=UTF-8' ); 27 header( 'Vary: Accept-Encoding' ); // Handle proxies 28 header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' ); 29 header( "Cache-Control: public, max-age=$expires_offset" ); 28 30 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') ) ) {31 if ( isset( $_GET['c'] ) && 1 == $_GET['c'] && isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) 32 && false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) && ( $file = get_file( $basepath . '/wp-tinymce.js.gz' ) ) ) { 31 33 32 header( 'Content-Encoding: gzip');34 header( 'Content-Encoding: gzip' ); 33 35 echo $file; 34 36 } else {
Note: See TracChangeset
for help on using the changeset viewer.