Project

General

Profile

Actions

Anomalie #838

closed

Bug: Incomplete sending of body: bad ob_flush optimization for php > 5.4.0

Added by Régis over 6 years ago. Updated over 6 years ago.

Status:
Fermé
Priority:
Normal
Assignee:
Category:
general
Target version:
Start date:
04/17/2018
Due date:
% Done:

100%

Estimated time:
0.50 h
Resolution:

Description

In www/public/index.php there is this piece of code:

 // ob_start has changed the way is works for PHP version > 5.4.0
 if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
       ob_start('optimize', 0, PHP_OUTPUT_HANDLER_STDFLAGS ^ PHP_OUTPUT_HANDLER_REMOVABLE);
 } else {
        ob_start('optimize');
 }

It should be (without the `^ PHP_OUTPUT_HANDLER_REMOVABLE` part):

 // ob_start has changed the way is works for PHP version > 5.4.0
 if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
       ob_start('optimize', 0, PHP_OUTPUT_HANDLER_STDFLAGS);
 } else {
        ob_start('optimize');
 }

I'm pretty sure this comes from a copy paste from http://php.net/manual/fr/function.ob-start.php, but the version adding the PHP_OUTPUT_HANDLER_REMOVABLE part was about the uneraseable type of buffer, which is not the case here.

Effects of this bugs are multiple, for example with Nginx + php-fopm some pages were rejected by Nginx (502/503) because of mismatchs in the HTTP response size from php.

Seen on version 2.0.

Actions

Also available in: Atom PDF