diff options
author | Gary Pendergast <pento@git.wordpress.org> | 2017-11-30 23:09:33 +0000 |
---|---|---|
committer | Gary Pendergast <pento@git.wordpress.org> | 2017-11-30 23:09:33 +0000 |
commit | 8f95800d52c1736d651ae6e259f90ad4a0db2c3f (patch) | |
tree | ee94827d31517e86d5c5f7c781ede278473ebf4a /src/wp-includes/js | |
parent | ec6a089f986f34a92568ac527f86f33f60fa83c2 (diff) | |
download | wordpress-8f95800d52c1736d651ae6e259f90ad4a0db2c3f.tar.gz wordpress-8f95800d52c1736d651ae6e259f90ad4a0db2c3f.zip |
Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.
Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.
git-svn-id: https://develop.svn.wordpress.org/trunk@42343 602fd350-edb4-49c9-b593-d223f7449a82
Diffstat (limited to 'src/wp-includes/js')
-rw-r--r-- | src/wp-includes/js/tinymce/wp-tinymce.php | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/wp-includes/js/tinymce/wp-tinymce.php b/src/wp-includes/js/tinymce/wp-tinymce.php index ea58e682d0..12d1c1c450 100644 --- a/src/wp-includes/js/tinymce/wp-tinymce.php +++ b/src/wp-includes/js/tinymce/wp-tinymce.php @@ -4,32 +4,34 @@ * * Set this to error_reporting( -1 ) for debugging. */ -error_reporting(0); +error_reporting( 0 ); -$basepath = dirname(__FILE__); +$basepath = dirname( __FILE__ ); -function get_file($path) { +function get_file( $path ) { - if ( function_exists('realpath') ) - $path = realpath($path); + if ( function_exists( 'realpath' ) ) { + $path = realpath( $path ); + } - if ( ! $path || ! @is_file($path) ) + if ( ! $path || ! @is_file( $path ) ) { return false; + } - return @file_get_contents($path); + return @file_get_contents( $path ); } $expires_offset = 31536000; // 1 year -header('Content-Type: application/javascript; charset=UTF-8'); -header('Vary: Accept-Encoding'); // Handle proxies -header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT'); -header("Cache-Control: public, max-age=$expires_offset"); +header( 'Content-Type: application/javascript; charset=UTF-8' ); +header( 'Vary: Accept-Encoding' ); // Handle proxies +header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' ); +header( "Cache-Control: public, max-age=$expires_offset" ); -if ( isset($_GET['c']) && 1 == $_GET['c'] && isset($_SERVER['HTTP_ACCEPT_ENCODING']) - && false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') ) ) { +if ( isset( $_GET['c'] ) && 1 == $_GET['c'] && isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) + && false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) && ( $file = get_file( $basepath . '/wp-tinymce.js.gz' ) ) ) { - header('Content-Encoding: gzip'); + header( 'Content-Encoding: gzip' ); echo $file; } else { // Back compat. This file shouldn't be used if this condition can occur (as in, if gzip isn't accepted). |