0
|
1 |
<?php |
|
2 |
/** |
9
|
3 |
* Not used in core since 5.1. |
|
4 |
* This is a back-compat for plugins that may be using this method of loading directly. |
|
5 |
*/ |
|
6 |
|
|
7 |
/** |
0
|
8 |
* Disable error reporting |
|
9 |
* |
5
|
10 |
* Set this to error_reporting( -1 ) for debugging. |
0
|
11 |
*/ |
9
|
12 |
error_reporting( 0 ); |
0
|
13 |
|
16
|
14 |
$basepath = __DIR__; |
0
|
15 |
|
9
|
16 |
function get_file( $path ) { |
0
|
17 |
|
9
|
18 |
if ( function_exists( 'realpath' ) ) { |
|
19 |
$path = realpath( $path ); |
|
20 |
} |
0
|
21 |
|
9
|
22 |
if ( ! $path || ! @is_file( $path ) ) { |
0
|
23 |
return false; |
9
|
24 |
} |
0
|
25 |
|
9
|
26 |
return @file_get_contents( $path ); |
0
|
27 |
} |
|
28 |
|
16
|
29 |
$expires_offset = 31536000; // 1 year. |
0
|
30 |
|
9
|
31 |
header( 'Content-Type: application/javascript; charset=UTF-8' ); |
16
|
32 |
header( 'Vary: Accept-Encoding' ); // Handle proxies. |
9
|
33 |
header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' ); |
|
34 |
header( "Cache-Control: public, max-age=$expires_offset" ); |
0
|
35 |
|
16
|
36 |
$file = get_file( $basepath . '/wp-tinymce.js' ); |
|
37 |
if ( isset( $_GET['c'] ) && $file ) { |
0
|
38 |
echo $file; |
|
39 |
} else { |
9
|
40 |
// Even further back compat. |
5
|
41 |
echo get_file( $basepath . '/tinymce.min.js' ); |
|
42 |
echo get_file( $basepath . '/plugins/compat3x/plugin.min.js' ); |
0
|
43 |
} |
|
44 |
exit; |