? Pending

User tests: Successful: Unsuccessful:

avatar zero-24
zero-24
26 Feb 2018

Pull Request for Issue #19784 .

Summary of Changes

@ggppdk provided a better check than the merged one in #19611

Testing Instructions

  • upload joomla to the server
  • set php_value output_buffering Off via htaccess
  • check the output_buffering values showed in the installer and in the backed.

Expected result

Setting is off also after that patch.

@sandewt @Quy @ggppdk please test this one here again. Thanks.

avatar zero-24 zero-24 - open - 26 Feb 2018
avatar zero-24 zero-24 - change - 26 Feb 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 26 Feb 2018
Category Administration com_admin Installation
avatar sandewt
sandewt - comment - 27 Feb 2018

I have tested this item ? unsuccessfully on c804164


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19791.

avatar sandewt sandewt - test_item - 27 Feb 2018 - Tested unsuccessfully
avatar sandewt
sandewt - comment - 27 Feb 2018

Explanation test

BACKEND: testing PATCH

1) php_value output_buffering Off
System Information > PHP Settings
Output Buffering: Off -> OK
System Information > PHP Information
Output Buffering: Off -> OK
2) php_value output_buffering On
System Information > PHP Settings
Output Buffering: Off -> NOK 
System Information > PHP Information
Output Buffering: On -> OK

Note: code patch

'output_buffering'   => (int) ini_get('output_buffering') !== 0,

When I change the code to: (see Note 2)

'output_buffering'   => ini_get('output_buffering') !== 0,

I have tested successfully (in backend + installer)

2) php_value output_buffering On
System Information > PHP Settings
Output Buffering: On -> OK 
System Information > PHP Information
Output Buffering: On -> OK

Note 2: Strange I could not repeat this latter successfully !?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19791.
avatar ggppdk
ggppdk - comment - 27 Feb 2018

That is what i explained above
[EDIT]
"not above" but in issue #19784

php_value output_buffering Off
is invalid !

php_value output_buffering ANY_TEXT
is invalid

and it results to output buffering being off

  • or in some servers you will get Internal server error

Please see PHP docs

  • to set a boolean value you are supposed to use

php_flag

with php_value output_buffering On
you did not enable the output buffer

  • you have just managed to set it into an invalid Text value
avatar ggppdk
ggppdk - comment - 27 Feb 2018

@sandewt

Please read here
#19784 (comment)

You can use the following to check the value of output_buffer
php_info()
or with
var_dump(ini_get('out_buffering'))

if you see a value 'On' or any text value that does not start with 1-9 then output buffering is disabled

Then, by testing the following you will see that you get "headers already sent error"
(aka output_buffering is disabled)

<?php
echo 'test';
header("Location: http://www.php.net");
exit;
avatar sandewt
sandewt - comment - 27 Feb 2018

@ggppdk

I have tested succesfully 'without' and 'with' the PATCH by using a boolean value (number).
I guess this is what you mean.
0 for Off and 4096 for On.

php_value output_buffering 0
and
php_value output_buffering 4096

without patch:
'output_buffering' => (bool) ini_get('output_buffering')
with patch:
'output_buffering' => (int) ini_get('output_buffering') !== 0

(I did not yet look at your test instructions above.)


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19791.

avatar ggppdk
ggppdk - comment - 27 Feb 2018
<?php
echo '<br>On is '; var_dump((bool) 'On');
echo '<br>Off is '; var_dump((bool) 'Off');
echo '<br>Test is '; var_dump((bool) 'Test');

exit;

will give

On is bool(true)
Off is bool(true)
Test is bool(true) 

But if output_buffering is set to the above TEXT values then in all above cases it will be disabled
aka old code is bogus

avatar brianteeman
brianteeman - comment - 27 Feb 2018

Note. The syntax for setting output_buffering is completely different when set in htaccess compared to when set in php.ini hence the confusions

avatar Quy
Quy - comment - 28 Feb 2018

Per php.ini, here are possible values. If using one of these values correctly, then the original PR should be fine...right?

; Possible Values:
;   On = Enabled and buffer is unlimited. (Use with caution)
;   Off = Disabled
;   Integer = Enables the buffer and sets its maximum size in bytes.
avatar brianteeman
brianteeman - comment - 28 Feb 2018

@Quy the syntax is completely different in htaccess

avatar zero-24
zero-24 - comment - 2 Mar 2018

What is the latest status here? Is this now a issue or not? So do we need to patch that until we release stable or not. I'm a bit lost about the truth in here.

cc @mbabker @rdeutz as if that is wrong now after my patch this should be fixed before we release 3.8.6. ;)

avatar ggppdk
ggppdk - comment - 2 Mar 2018

Propably it is best to fix it for J3.8.6

because if it was wrong only for the case of misconfiguration text value "blabla" or "On" or "Off"
-- then it could wait

but current code:
is_numeric() thing
gives true when it is "0" aka when it is turned off
thus it is really wrong, reporting output_buffering as always ON,

but again this is nothing critical right it is just for information


Testing instructions

  • Any text value and ZERO value should be detected as OFF
  • Any non-zero number or string that starts with integer should be detected as ON

e.g. 4096 or 1 or -4096test should be detected as "Enabled"


to test if it is enabled create file

<?php
echo 'test';
header("Test: test");
exit;

if you see error message
Warning: Cannot modify header information - headers already sent by

  • then it is disabled, if you do not see then it is enabled

.htaccess:

php_value output_buffering 4096      IS ENABLED
php_value output_buffering 0            IS not 
php_value output_buffering On         IS not 
php_value output_buffering Test        IS not 
php_value output_buffering -4096Test       IS  ENABLED

php_flag output_buffering on      IS  ENABLED
php_flag output_buffering off      IS not

php.ini (restart webserver if needed)

output_buffering=off       IS not 
output_buffering=on       IS  ENABLED
output_buffering=0         IS not 
output_buffering=4096   IS  ENABLED
avatar sandewt
sandewt - comment - 7 Mar 2018

I have tested this item successfully on c804164

>Propably it is best to fix it for J3.8.6

See commnent with results.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19791.

avatar sandewt sandewt - test_item - 7 Mar 2018 - Tested successfully
avatar sandewt
sandewt - comment - 7 Mar 2018

Propably it is best to fix it for J3.8.6

@ggppdk please check before patch -> with patch

Results

BACKEND before patch -> with patch

php_value output_buffering 4096 IS ENABLED: On -> On
php_value output_buffering 0 IS not: On + warning -> Off + warning
php_value output_buffering On IS not: On + warning -> Off + warning
php_value output_buffering Test IS not: Off + warning -> Off + warning
php_value output_buffering -4096Test IS ENABLED:  Off -> On

php_flag output_buffering on IS ENABLED: On -> On
php_flag output_buffering off IS not: On + warning -> Off + warning

warning: headers already sent by ...

INSTALLER before patch -> with patch

php_value output_buffering 4096 IS ENABLED: Aan -> Aan
php_value output_buffering 0 IS not: Uit -> Uit
php_value output_buffering On IS not: Aan -> Uit
php_value output_buffering Test IS not: Aan -> Uit
php_value output_buffering -4096Test IS ENABLED:  Aan -> Aan

php_flag output_buffering on IS ENABLED: Aan -> Aan
php_flag output_buffering off IS not: Uit -> Uit

On = Aan = IS ENABLED
Off = Uit = IS not  
avatar ggppdk
ggppdk - comment - 7 Mar 2018

@sandewt

i see you also run the script that creates the warning to really confirm output_buffering being disabled or enabled

yes all your results after patch look correct

avatar sandewt
sandewt - comment - 7 Mar 2018

i see you also run the script that creates the warning to really confirm output_buffering being disabled or enabled

@ggppdk

Yes indeed. I used the script only for the backend.

Remarkably the results, before the patch are different for the backend and the installer.

(Afterwards I could also test in English for the installer.)


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19791.
avatar Quy
Quy - comment - 7 Mar 2018

Why is -4096Test a valid value/enabled?

avatar ggppdk
ggppdk - comment - 7 Mar 2018

Why is -4096Test a valid value/enabled?

It will enable output buffering,
so we need to catch such "bad" case too

please test it (using the script i provided above) and see if output_buffering gets enabled, if you get no header sent warning it means that output_buffering was enabled

avatar Quy
Quy - comment - 10 Mar 2018

I have tested this item successfully on c804164


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19791.

avatar Quy Quy - test_item - 10 Mar 2018 - Tested successfully
avatar Quy Quy - change - 10 Mar 2018
Status Pending Ready to Commit
avatar Quy
Quy - comment - 10 Mar 2018

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19791.

avatar mbabker mbabker - change - 12 Mar 2018
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-03-12 11:06:49
Closed_By mbabker
Labels Added: ?
avatar mbabker mbabker - close - 12 Mar 2018
avatar mbabker mbabker - merge - 12 Mar 2018

Add a Comment

Login with GitHub to post a comment