Bug #71730 [Opn->Ver]: compression fails

From: Date: Thu, 14 Jun 2018 11:19:09 +0000
Subject: Bug #71730 [Opn->Ver]: compression fails
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215719@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71730&edit=1

 ID:                 71730
 Updated by:         mike@php.net
 Reported by:        wowkise at gmai dot com
 Summary:            compression fails
-Status:             Open
+Status:             Verified
 Type:               Bug
 Package:            Output Control
 Operating System:   ubuntu
-PHP Version:        Irrelevant
+PHP Version:        7.2
 Block user comment: N
 Private report:     N

 New Comment:

Verified


Previous Comments:
------------------------------------------------------------------------
[2016-03-07 15:06:40] wowkise at gmai dot com

Description:
------------
if you take a look at the test script, the output_compression shouldn't have been sent, as
there is an output before it,

however, on Ubuntu 15.10, Using php5-fpm nginx, the headers get sent anyway regardless if there is
content before it or not, and that's breaks browsers, and shows errors such as 

Chrome:
This webpage is not available - ERR_CONTENT_DECODING_FAILED

Firefox:
Content Encoding Error

The page you are trying to view cannot be shown because it uses an invalid or unsupported form of
compression.


Test script:
---------------
<?php

$obj = (object) [
    'foo' => 'bar'
];

var_dump( $obj );

if ( !headers_sent() )
{
    ini_set( 'zlib.output_compression', 1 );
}


Expected result:
----------------
the header shouldn't have been sent.

Actual result:
--------------
the header get sent which garbled the output, which in turn breaks the output_compression, and
causes the browsers to show error.


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=71730&edit=1


Thread (7 messages)

« previous php.bugs (#215719) next »