Bug #16772 » 0004623_w.patch
t3lib/class.gzip_encode.php (Arbeitskopie) | ||
---|---|---|
}
|
||
/*
|
||
/**
|
||
* gzip_accepted() - Test headers for Accept-Encoding: gzip
|
||
*
|
||
* Returns: if proper headers aren't found: false
|
||
* if proper headers are found: 'gzip' or 'x-gzip'
|
||
*
|
||
... | ... | |
* }
|
||
* note the double colon syntax, I don't know where it is documented but
|
||
* somehow it got in my brain.
|
||
*/
|
||
*
|
||
* @return mixed Returns 'gzip' if the client browser accepts gzip encoding, otherwise false
|
||
**/
|
||
function gzip_accepted() {
|
||
if (strpos(getenv("HTTP_ACCEPT_ENCODING"), 'gzip') === false) return false;
|
||
if (strpos(getenv("HTTP_ACCEPT_ENCODING"), 'x-gzip') === false) {
|
||
// Checks, if the accepted encoding supports gzip or x-gzip.
|
||
// Furthermore a qvalue check is done. "gzip;q=0" means to gzip accepted at all.
|
||
$acceptEncoding = t3lib_div::getIndpEnv('HTTP_ACCEPT_ENCODING');
|
||
if (preg_match('/(^|,\s*)(x-)?gzip(;q=(\d(\.\d+)?))?(,|$)/', $acceptEncoding, $match) && ($match[4] === '' || $match[4] > 0)) {
|
||
$encoding = 'gzip';
|
||
} else {
|
||
$encoding = 'x-gzip';
|
||
return false;
|
||
}
|
||
// Test file type. I wish I could get HTTP response headers.
|
t3lib/class.t3lib_div.php (Arbeitskopie) | ||
---|---|---|
case 'HTTP_HOST':
|
||
case 'HTTP_USER_AGENT':
|
||
case 'HTTP_ACCEPT_LANGUAGE':
|
||
case 'HTTP_ACCEPT_ENCODING':
|
||
case 'QUERY_STRING':
|
||
$retVal = $_SERVER[$getEnvName];
|
||
break;
|