]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-includes/js/tinymce/wp-tinymce.php
Wordpress 2.8
[autoinstalls/wordpress.git] / wp-includes / js / tinymce / wp-tinymce.php
1 <?php
2
3 $basepath = dirname(__FILE__);
4
5 function get_file($path) {
6
7         if ( function_exists('realpath') )
8                 $path = realpath($path);
9
10         if ( ! $path || ! @is_file($path) )
11                 return '';
12
13         return @file_get_contents($path);
14 }
15
16 $expires_offset = 31536000;
17
18 header('Content-Type: application/x-javascript; charset=UTF-8');
19 header('Vary: Accept-Encoding'); // Handle proxies
20 header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
21 header("Cache-Control: public, max-age=$expires_offset");
22
23 if ( isset($_GET['c']) && 1 == $_GET['c'] && false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') ) {
24         header('Content-Encoding: gzip');
25         echo get_file($basepath . '/wp-tinymce.js.gz');
26 } else {
27         echo get_file($basepath . '/wp-tinymce.js');
28 }
29 exit;