2009-01-16 07:58:38 -05:00
|
|
|
<?php
|
2019-01-18 14:51:53 -05: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 04:46:07 -05:00
|
|
|
/**
|
|
|
|
* Disable error reporting
|
|
|
|
*
|
2014-07-07 12:42:16 -04:00
|
|
|
* Set this to error_reporting( -1 ) for debugging.
|
2009-11-19 04:46:07 -05:00
|
|
|
*/
|
2017-11-30 18:11:00 -05:00
|
|
|
error_reporting( 0 );
|
2009-01-16 07:58:38 -05:00
|
|
|
|
2020-02-06 01:33:11 -05:00
|
|
|
$basepath = __DIR__;
|
2009-01-17 09:08:15 -05:00
|
|
|
|
2017-11-30 18:11:00 -05:00
|
|
|
function get_file( $path ) {
|
2009-01-16 07:58:38 -05:00
|
|
|
|
2017-11-30 18:11:00 -05:00
|
|
|
if ( function_exists( 'realpath' ) ) {
|
|
|
|
$path = realpath( $path );
|
|
|
|
}
|
2009-01-16 07:58:38 -05:00
|
|
|
|
2017-11-30 18:11:00 -05:00
|
|
|
if ( ! $path || ! @is_file( $path ) ) {
|
2009-06-16 21:06:32 -04:00
|
|
|
return false;
|
2017-11-30 18:11:00 -05:00
|
|
|
}
|
2009-01-16 07:58:38 -05:00
|
|
|
|
2017-11-30 18:11:00 -05:00
|
|
|
return @file_get_contents( $path );
|
2009-01-16 07:58:38 -05:00
|
|
|
}
|
|
|
|
|
2020-01-28 19:45:18 -05:00
|
|
|
$expires_offset = 31536000; // 1 year.
|
2009-01-16 07:58:38 -05:00
|
|
|
|
2017-11-30 18:11:00 -05:00
|
|
|
header( 'Content-Type: application/javascript; charset=UTF-8' );
|
2020-01-28 19:45:18 -05:00
|
|
|
header( 'Vary: Accept-Encoding' ); // Handle proxies.
|
2017-11-30 18:11:00 -05: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 07:58:38 -05:00
|
|
|
|
2019-07-02 19:42:58 -04:00
|
|
|
$file = get_file( $basepath . '/wp-tinymce.js' );
|
|
|
|
if ( isset( $_GET['c'] ) && $file ) {
|
2009-06-16 21:06:32 -04:00
|
|
|
echo $file;
|
2009-01-16 07:58:38 -05:00
|
|
|
} else {
|
2019-01-18 14:51:53 -05:00
|
|
|
// Even further back compat.
|
2014-04-11 18:16:14 -04:00
|
|
|
echo get_file( $basepath . '/tinymce.min.js' );
|
|
|
|
echo get_file( $basepath . '/plugins/compat3x/plugin.min.js' );
|
2009-01-16 07:58:38 -05:00
|
|
|
}
|
|
|
|
exit;
|