note 70672 added to function.gzcompress
| From: | php-general at lists dot php dot net | Date: | Mon, 23 Oct 2006 19:59:20 +0000 |
| Subject: | note 70672 added to function.gzcompress | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-119028@lists.php.net to get a copy of this message | ||
I am not sure why but many people don't know about the x-gzip encoding header so the code below
should be rewritten as
<?php
if( strstr( $_SERVER['HTTP_USER_AGENT'], 'W3C_Validator' ) !== false || strstr(
$_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) === false ||
$_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip' ) === false){
// do not compress
} else {
// can send GZIP compressed data
}
?>
I don't think that ob_start(); checks for this and if it does not, it Should!
----
Server IP: 64.71.164.2
Probable Submitter: 24.214.104.136
----
Manual Page -- http://www.php.net/manual/en/function.gzcompress.php
Edit -- https://master.php.net/note/edit/70672
Del: integrated -- https://master.php.net/note/delete/70672/integrated
Del: useless -- https://master.php.net/note/delete/70672/useless
Del: bad code -- https://master.php.net/note/delete/70672/bad+code
Del: spam -- https://master.php.net/note/delete/70672/spam
Del: non-english -- https://master.php.net/note/delete/70672/non-english
Del: in docs -- https://master.php.net/note/delete/70672/in+docs
Del: other reasons-- https://master.php.net/note/delete/70672
Reject -- https://master.php.net/note/reject/70672
Search -- https://master.php.net/manage/user-notes.php