Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-10188

Broken compressed output when errors/warnings are handled by phpbb and output_buffering is set to 4096 and phpbb gzip is enabled



      Originally reported on Russian IST board: http://www.phpbbguru.net/community/topic16064-420.html#p326091


      1. output_buffering is set to 4096 in php.ini;
      2. gzip compression is enabled in phpbb;
      3. a warning or a notice is produced somewhere,

      then the resulting output is not a valid compressed stream, although it has gzip headers, and results in different browsers either reporting a compression error or just displaying nothing.

      In includes/functions.php line #3746 (current develop-olympus) there's a check:

      				// flush the content, else we get a white page if output buffering is on
      				if ((int) @ini_get('output_buffering') === 1 || strtolower(@ini_get('output_buffering')) === 'on')

      As per PHP manual on output_buffering setting:

      You can enable output buffering for all files by setting this directive to 'On'. If you wish to limit the size of the buffer to a certain size - you can use a maximum number of bytes instead of 'On', as a value for this directive (e.g., output_buffering=4096). As of PHP 4.3.5, this directive is always Off in PHP-CLI.

      Thus, the value of output_buffering setting in switched on state can differ from 1 or on.
      This causes page can't be displayed on E_NOTICE or E_WARNING in some cases.


          Issue Links



              • Assignee:
                naderman Nils Adermann
                rxu rxu
              • Votes:
                0 Vote for this issue
                0 Start watching this issue


                • Created: