/wp-includes/js/tinymce/wp-tinymce.php

  1. <?php 
  2. /** 
  3. * Disable error reporting 
  4. * 
  5. * Set this to error_reporting( -1 ) for debugging. 
  6. */ 
  7. error_reporting(0); 
  8.  
  9. $basepath = dirname(__FILE__); 
  10.  
  11. function get_file($path) { 
  12.  
  13. if ( function_exists('realpath') ) 
  14. $path = realpath($path); 
  15.  
  16. if ( ! $path || ! @is_file($path) ) 
  17. return false; 
  18.  
  19. return @file_get_contents($path); 
  20.  
  21. $expires_offset = 31536000; // 1 year 
  22.  
  23. header('Content-Type: application/javascript; charset=UTF-8'); 
  24. header('Vary: Accept-Encoding'); // Handle proxies 
  25. header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT'); 
  26. header("Cache-Control: public, max-age=$expires_offset"); 
  27.  
  28. if ( isset($_GET['c']) && 1 == $_GET['c'] && isset($_SERVER['HTTP_ACCEPT_ENCODING']) 
  29. && false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') ) ) { 
  30.  
  31. header('Content-Encoding: gzip'); 
  32. echo $file; 
  33. } else { 
  34. // Back compat. This file shouldn't be used if this condition can occur (as in, if gzip isn't accepted). 
  35. echo get_file( $basepath . '/tinymce.min.js' ); 
  36. echo get_file( $basepath . '/plugins/compat3x/plugin.min.js' ); 
  37. exit; 
.