-
Notifications
You must be signed in to change notification settings - Fork 8k
Fix #77594: ob_tidyhandler is never reset #6425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
There is a related test failure. |
|
Yes, we cannot simply reset, because we need to heed the INI setting. |
|
Might make more sense to implement the clean_output = 1 assignment by actually changing the ini setting? That would also make it automatically revert. It should also be possible to test this, assuming that run-tests.php is invoked in --repeat 2 mode. (The test would only be actually "useful" on master.) |
We also add a test case.
Good idea, but the situation is more messy than expected. Consider the following script: <?php
echo "something\n";
ob_start('ob_tidyhandler');
echo "else\n";Output as is: Output with the suggested change: And consider this script: <?php
ob_start('ob_tidyhandler');
ob_end_clean();
echo "something\n";Output as is: Output with the suggested change: The current behavior of the first script looks erroneous, but some code might rely on changing the output handler after output has been produced. The modified behavior of the second script would be wrong, so we had to reset the INI setting (in the output_handler's dtor?). Maybe it's best to stick with the manual reset on RSHUTDOWN for 7.4, and figure out a clean solution for the "master" branch? |
@nikic, thoughts? |
nikic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense.
No description provided.