gzip compressed pages

Found a bug? Tell us!!
Post Reply
manafta
Posts: 1
Joined: Tue Mar 08, 2005 9:48 pm
Location: The Netherlands

gzip compressed pages

Post by manafta »

I'm glad to see that gzip can be used in s9y 0.8. But if on the server zlib.output_compression is set to On, you get an error message because it conflicts with ob_gzhandler. So an extra check for the zlib.output_compression should be added.

The following code fixes this:

Code: Select all

function serendipity_gzCompression() {
    global $serendipity;
    if (isset($serendipity['useGzip']) && serendipity_db_bool($serendipity['useGzip']) && function_exists('ob_gzhandler') && extension_loaded('zlib') && ini_get('zlib.output_compression')!=1) {
        ob_start("ob_gzhandler");
    }
}
tomsommer
Core Developer
Posts: 240
Joined: Tue Sep 02, 2003 6:43 pm
Location: Denmark
Contact:

Post by tomsommer »

Thanks, I fixed this in CVS
Tom Sommer (Serendipity Core Developer)
http://blog.dreamcoder.dk
Post Reply