equal
deleted
inserted
replaced
9 * |
9 * |
10 * Set this to error_reporting( -1 ) for debugging. |
10 * Set this to error_reporting( -1 ) for debugging. |
11 */ |
11 */ |
12 error_reporting( 0 ); |
12 error_reporting( 0 ); |
13 |
13 |
14 $basepath = dirname( __FILE__ ); |
14 $basepath = __DIR__; |
15 |
15 |
16 function get_file( $path ) { |
16 function get_file( $path ) { |
17 |
17 |
18 if ( function_exists( 'realpath' ) ) { |
18 if ( function_exists( 'realpath' ) ) { |
19 $path = realpath( $path ); |
19 $path = realpath( $path ); |
24 } |
24 } |
25 |
25 |
26 return @file_get_contents( $path ); |
26 return @file_get_contents( $path ); |
27 } |
27 } |
28 |
28 |
29 $expires_offset = 31536000; // 1 year |
29 $expires_offset = 31536000; // 1 year. |
30 |
30 |
31 header( 'Content-Type: application/javascript; charset=UTF-8' ); |
31 header( 'Content-Type: application/javascript; charset=UTF-8' ); |
32 header( 'Vary: Accept-Encoding' ); // Handle proxies |
32 header( 'Vary: Accept-Encoding' ); // Handle proxies. |
33 header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' ); |
33 header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' ); |
34 header( "Cache-Control: public, max-age=$expires_offset" ); |
34 header( "Cache-Control: public, max-age=$expires_offset" ); |
35 |
35 |
36 if ( isset( $_GET['c'] ) && ( $file = get_file( $basepath . '/wp-tinymce.js' ) ) ) { |
36 $file = get_file( $basepath . '/wp-tinymce.js' ); |
|
37 if ( isset( $_GET['c'] ) && $file ) { |
37 echo $file; |
38 echo $file; |
38 } else { |
39 } else { |
39 // Even further back compat. |
40 // Even further back compat. |
40 echo get_file( $basepath . '/tinymce.min.js' ); |
41 echo get_file( $basepath . '/tinymce.min.js' ); |
41 echo get_file( $basepath . '/plugins/compat3x/plugin.min.js' ); |
42 echo get_file( $basepath . '/plugins/compat3x/plugin.min.js' ); |