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

https://bitbucket.org/jimjenkins5/blog · PHP · 37 lines · 23 code · 9 blank · 5 comment · 10 complexity · cb5d42d344a636470233d306c7bbb958 MD5 · raw file

  1. <?php
  2. /**
  3. * Disable error reporting
  4. *
  5. * Set this to error_reporting( E_ALL ) or error_reporting( E_ALL | E_STRICT ) for debugging
  6. */
  7. error_reporting(0);
  8. $basepath = dirname(__FILE__);
  9. function get_file($path) {
  10. if ( function_exists('realpath') )
  11. $path = realpath($path);
  12. if ( ! $path || ! @is_file($path) )
  13. return false;
  14. return @file_get_contents($path);
  15. }
  16. $expires_offset = 31536000;
  17. header('Content-Type: application/x-javascript; charset=UTF-8');
  18. header('Vary: Accept-Encoding'); // Handle proxies
  19. header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
  20. header("Cache-Control: public, max-age=$expires_offset");
  21. if ( isset($_GET['c']) && 1 == $_GET['c'] && isset($_SERVER['HTTP_ACCEPT_ENCODING'])
  22. && false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') ) ) {
  23. header('Content-Encoding: gzip');
  24. echo $file;
  25. } else {
  26. echo get_file($basepath . '/tiny_mce.js');
  27. }
  28. exit;