equal
deleted
inserted
replaced
1 <?php |
1 <?php |
|
2 /** |
|
3 * Disable error reporting |
|
4 * |
|
5 * Set this to error_reporting( E_ALL ) or error_reporting( E_ALL | E_STRICT ) for debugging |
|
6 */ |
|
7 error_reporting(0); |
2 |
8 |
3 $basepath = dirname(__FILE__); |
9 $basepath = dirname(__FILE__); |
4 |
10 |
5 function get_file($path) { |
11 function get_file($path) { |
6 |
12 |
18 header('Content-Type: application/x-javascript; charset=UTF-8'); |
24 header('Content-Type: application/x-javascript; charset=UTF-8'); |
19 header('Vary: Accept-Encoding'); // Handle proxies |
25 header('Vary: Accept-Encoding'); // Handle proxies |
20 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'); |
21 header("Cache-Control: public, max-age=$expires_offset"); |
27 header("Cache-Control: public, max-age=$expires_offset"); |
22 |
28 |
23 if ( isset($_GET['c']) && 1 == $_GET['c'] && false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') ) ) { |
29 if ( isset($_GET['c']) && 1 == $_GET['c'] && isset($_SERVER['HTTP_ACCEPT_ENCODING']) |
|
30 && false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') ) ) { |
|
31 |
24 header('Content-Encoding: gzip'); |
32 header('Content-Encoding: gzip'); |
25 echo $file; |
33 echo $file; |
26 } else { |
34 } else { |
27 echo get_file($basepath . '/wp-tinymce.js'); |
35 echo get_file($basepath . '/wp-tinymce.js'); |
28 } |
36 } |