Wrongly detected when
ini_get('output_buffering') === 'On'
any non numeric and text value means off (a misconfiguration)ini_get('output_buffering') === '0'
wrongly detected because we do'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)
Labels |
Added:
?
|
Title |
|
Category | ⇒ | Administration |
But Isn't than 'output_buffering
=== off also invalid / misconfiguration?
Status | New | ⇒ | Discussion |
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)
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;
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"
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-02-26 22:25:59 |
Closed_By | ⇒ | Quy |
Closed_By | Quy | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/19784
@zero-24 , @Quy
Issue due to PR #19611,
The PR tried to fix real issue #19033 ?
but the fix was not correct