includes/clientside/tinymce/tiny_mce_gzip.php
changeset 547 0a2c1ce32d91
parent 545 e4c8e706f167
child 685 17ebe24cdf85
equal deleted inserted replaced
546:506e8e3e2af2 547:0a2c1ce32d91
    91 
    91 
    92 	if ((in_array('gzip', $encodings) || in_array('x-gzip', $encodings) || isset($_SERVER['---------------'])) && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')) {
    92 	if ((in_array('gzip', $encodings) || in_array('x-gzip', $encodings) || isset($_SERVER['---------------'])) && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')) {
    93 		$enc = in_array('x-gzip', $encodings) ? "x-gzip" : "gzip";
    93 		$enc = in_array('x-gzip', $encodings) ? "x-gzip" : "gzip";
    94 		$supportsGzip = true;
    94 		$supportsGzip = true;
    95 	}
    95 	}
       
    96   
       
    97   // Send an ETag (Enano modification 5/5/2008)
       
    98   if ( isset($cacheKey) )
       
    99   {
       
   100     $etag =& $cacheKey;
       
   101     header("ETag: \"$etag\"");
       
   102     if ( isset($_SERVER['HTTP_IF_NONE_MATCH']) )
       
   103     {
       
   104       if ( "\"$etag\"" == $_SERVER['HTTP_IF_NONE_MATCH'] )
       
   105       {
       
   106         header('HTTP/1.1 304 Not Modified');
       
   107         exit();
       
   108       }
       
   109     }
       
   110   }
    96 
   111 
    97 	// Use cached file disk cache
   112 	// Use cached file disk cache
    98 	if ($diskCache && $supportsGzip && file_exists($cacheFile)) {
   113 	if ($diskCache && $supportsGzip && file_exists($cacheFile)) {
    99 		if ($compress)
   114 		if ($compress)
   100 			header("Content-Encoding: " . $enc);
   115 			header("Content-Encoding: " . $enc);
   136 		$content .= getFileContents($file);
   151 		$content .= getFileContents($file);
   137 
   152 
   138 	// Restore loading functions
   153 	// Restore loading functions
   139 	if ($core == "true")
   154 	if ($core == "true")
   140 		$content .= "tinyMCE_GZ.end();";
   155 		$content .= "tinyMCE_GZ.end();";
   141 
   156   
   142 	// Generate GZIP'd content
   157 	// Generate GZIP'd content
   143 	if ($supportsGzip) {
   158 	if ($supportsGzip) {
   144 		if ($compress) {
   159 		if ($compress) {
   145 			header("Content-Encoding: " . $enc);
   160 			header("Content-Encoding: " . $enc);
   146 			$cacheData = gzencode($content, 9, FORCE_GZIP);
   161 			$cacheData = gzencode($content, 9, FORCE_GZIP);