?
avatar ggppdk
ggppdk
26 Feb 2018

Wrongly detected when

  1. ini_get('output_buffering') === 'On' any non numeric and text value means off (a misconfiguration)
  2. ini_get('output_buffering') === '0' wrongly detected because we do

https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_admin/models/sysinfo.php#L251

'output_buffering' => ($outputBuffering === 'On') ? true : is_numeric($outputBuffering),

aka we use is_numeric($outputBuffering) but is_numeric on '0' returns true

Number 2 is most important, since 1 number is a misconfiguration although it may not be an uncommon misconfiguration

See comment
#19611 (comment)

avatar ggppdk ggppdk - open - 26 Feb 2018
avatar joomla-cms-bot joomla-cms-bot - change - 26 Feb 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 26 Feb 2018
avatar ggppdk ggppdk - change - 26 Feb 2018
Title
output_buffering check broken
output_buffering check broken in sys information report
avatar ggppdk ggppdk - edited - 26 Feb 2018
avatar ggppdk
ggppdk - comment - 26 Feb 2018

@zero-24 , @Quy

Issue due to PR #19611,
The PR tried to fix real issue #19033 ?
but the fix was not correct

avatar franz-wohlkoenig franz-wohlkoenig - change - 26 Feb 2018
Category Administration
avatar sandewt
sandewt - comment - 26 Feb 2018

See also PR #19612.

avatar zero-24
zero-24 - comment - 26 Feb 2018

But Isn't than 'output_buffering === off also invalid / misconfiguration?

avatar franz-wohlkoenig franz-wohlkoenig - change - 26 Feb 2018
Status New Discussion
avatar ggppdk
ggppdk - comment - 26 Feb 2018

But Isn't than 'output_buffering === off also invalid / misconfiguration?

Yes === 'off' is invalid (you are supposed to use php_flag output_buffering off to set a boolean 'off')
just i do not mention it above because it is correctly detected by current code as OFF

If you try to set it to a text value
php_value output_buffering On (and any text value)

  • on some servers it will give internal error,
  • on some it will be accepted just it results to output buffering being off

php_flag output_buffering on (.htaccess)
output_buffering=on (php.ini, restart apache if needed)

Both of the above will set output_buffering to '1' (output buffering enabled)
var_dump(ini_get('output_buffering'));

Display:
string(1) "1"

Please note also that this will enable output buffering ... despite being negative and having text at its end
(it will enable it if you do not get an internal server error)
php_value output_buffering -4096test

So correct detection is
$isEnabled = (int) ini_get('output_buffering') !== 0;

avatar ggppdk
ggppdk - comment - 26 Feb 2018

I do not mention it above but it is similar to On case

php_flag output_buffering off (.htaccess)
output_buffering=off (php.ini, restart apache if needed)

Both of the above will set output_buffering to '0' (output buffering disabled)
var_dump(ini_get('output_buffering'));

Display:
string(1) "0"

avatar zero-24
zero-24 - comment - 26 Feb 2018

PR: #19791 Thanks for the report!

avatar Quy Quy - change - 26 Feb 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-02-26 22:25:59
Closed_By Quy
avatar joomla-cms-bot joomla-cms-bot - change - 26 Feb 2018
Closed_By Quy joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 26 Feb 2018
avatar joomla-cms-bot
joomla-cms-bot - comment - 26 Feb 2018

Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/19784

Add a Comment

Login with GitHub to post a comment