source: trunk/www.guidonia.net/wp/wp-includes/js/tinymce/wp-tinymce.php@ 44

Last change on this file since 44 was 44, checked in by luciano, 14 years ago
File size: 801 bytes
Line 
1<?php
2
3$basepath = dirname(__FILE__);
4
5function get_file($path) {
6
7 if ( function_exists('realpath') )
8 $path = realpath($path);
9
10 if ( ! $path || ! @is_file($path) )
11 return false;
12
13 return @file_get_contents($path);
14}
15
16$expires_offset = 31536000;
17
18header('Content-Type: application/x-javascript; charset=UTF-8');
19header('Vary: Accept-Encoding'); // Handle proxies
20header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
21header("Cache-Control: public, max-age=$expires_offset");
22
23if ( isset($_GET['c']) && 1 == $_GET['c'] && false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') ) ) {
24 header('Content-Encoding: gzip');
25 echo $file;
26} else {
27 echo get_file($basepath . '/wp-tinymce.js');
28}
29exit;
Note: See TracBrowser for help on using the repository browser.