2009-01-16 13:58:38 +01:00
|
|
|
<?php
|
2019-01-18 20:51:53 +01:00
|
|
|
/**
|
|
|
|
* Not used in core since 5.1.
|
|
|
|
* This is a back-compat for plugins that may be using this method of loading directly.
|
|
|
|
*/
|
|
|
|
|
2009-11-19 10:46:07 +01:00
|
|
|
/**
|
|
|
|
* Disable error reporting
|
|
|
|
*
|
2014-07-07 18:42:16 +02:00
|
|
|
* Set this to error_reporting( -1 ) for debugging.
|
2009-11-19 10:46:07 +01:00
|
|
|
*/
|
2017-12-01 00:11:00 +01:00
|
|
|
error_reporting( 0 );
|
2009-01-16 13:58:38 +01:00
|
|
|
|
2020-02-06 07:33:11 +01:00
|
|
|
$basepath = __DIR__;
|
2009-01-17 15:08:15 +01:00
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
function get_file( $path ) {
|
2009-01-16 13:58:38 +01:00
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
if ( function_exists( 'realpath' ) ) {
|
|
|
|
$path = realpath( $path );
|
|
|
|
}
|
2009-01-16 13:58:38 +01:00
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
if ( ! $path || ! @is_file( $path ) ) {
|
2009-06-17 03:06:32 +02:00
|
|
|
return false;
|
2017-12-01 00:11:00 +01:00
|
|
|
}
|
2009-01-16 13:58:38 +01:00
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
return @file_get_contents( $path );
|
2009-01-16 13:58:38 +01:00
|
|
|
}
|
|
|
|
|
2020-01-29 01:45:18 +01:00
|
|
|
$expires_offset = 31536000; // 1 year.
|
2009-01-16 13:58:38 +01:00
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
header( 'Content-Type: application/javascript; charset=UTF-8' );
|
2020-01-29 01:45:18 +01:00
|
|
|
header( 'Vary: Accept-Encoding' ); // Handle proxies.
|
2017-12-01 00:11:00 +01:00
|
|
|
header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' );
|
|
|
|
header( "Cache-Control: public, max-age=$expires_offset" );
|
2009-01-16 13:58:38 +01:00
|
|
|
|
2019-07-03 01:42:58 +02:00
|
|
|
$file = get_file( $basepath . '/wp-tinymce.js' );
|
|
|
|
if ( isset( $_GET['c'] ) && $file ) {
|
2009-06-17 03:06:32 +02:00
|
|
|
echo $file;
|
2009-01-16 13:58:38 +01:00
|
|
|
} else {
|
2019-01-18 20:51:53 +01:00
|
|
|
// Even further back compat.
|
2014-04-12 00:16:14 +02:00
|
|
|
echo get_file( $basepath . '/tinymce.min.js' );
|
|
|
|
echo get_file( $basepath . '/plugins/compat3x/plugin.min.js' );
|
2009-01-16 13:58:38 +01:00
|
|
|
}
|
|
|
|
exit;
|