Skip to content

[4.4] Fix output buffering - #7500

Merged
kenjis merged 4 commits into
codeigniter4:4.4from
iRedds:fix-output-buffering
May 23, 2023
Merged

kenjis merged 4 commits into
codeigniter4:4.4from
iRedds:fix-output-buffering

Conversation

@iRedds

@iRedds iRedds commented May 15, 2023

Copy link
Copy Markdown
Collaborator

Description
Fixes #7493

Work with output buffering was carried out incorrectly.

To bypass an existing bug in tests, a hack was used

if (ob_get_level() > 1) {
ob_end_clean();
}

In my opinion, this PR correctly completes output buffering, including for exceptions.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@iRedds iRedds closed this May 15, 2023
@iRedds
iRedds deleted the fix-output-buffering branch May 15, 2023 07:27
@iRedds
iRedds restored the fix-output-buffering branch May 15, 2023 07:28
@iRedds iRedds reopened this May 15, 2023
@iRedds
iRedds changed the base branch from develop to 4.4 May 15, 2023 07:30
@iRedds

iRedds commented May 15, 2023

Copy link
Copy Markdown
Collaborator Author

Error installing Imagic. Tests are not available.

@kenjis kenjis added 4.4 bug Verified issues on the current code behavior or pull requests that will fix them labels May 15, 2023

@michalsn michalsn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a really good find and improvement. Thanks!

I have tested it a bit and see no issues.

@michalsn michalsn linked an issue May 17, 2023 that may be closed by this pull request
Comment thread system/CodeIgniter.php
@kenjis
kenjis merged commit 2f576d3 into codeigniter4:4.4 May 23, 2023
@kenjis

kenjis commented May 23, 2023

Copy link
Copy Markdown
Member

@iRedds Thank you. This made CodeIgniter.php code cleaner.

@kenjis kenjis mentioned this pull request May 24, 2023
@iRedds
iRedds deleted the fix-output-buffering branch May 24, 2023 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Verified issues on the current code behavior or pull requests that will fix them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: output buffer

3 participants