Skip to content
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

fix: exceptions for non-HTML responses #9308

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion system/Debug/ExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ public function handle(
}

if (! str_contains($request->getHeaderLine('accept'), 'text/html')) {
$data = (ENVIRONMENT === 'development' || ENVIRONMENT === 'testing')
$data = in_array(
strtolower(ini_get('display_errors')),
['1', 'true', 'on', 'yes'],
true
)
michalsn marked this conversation as resolved.
Show resolved Hide resolved
? $this->collectVars($exception, $statusCode)
: '';

Expand Down
1 change: 1 addition & 0 deletions user_guide_src/source/changelogs/v4.5.6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Bugs Fixed
- **Validation:** Fixed a bug where complex language strings were not properly handled.
- **CURLRequest:** Added support for handling proxy responses using HTTP versions other than 1.1.
- **Database:** Fixed a bug that caused ``Postgre\Connection::reconnect()`` method to throw an error when the connection had not yet been established.
- **Exception:** Fixed a bug where exceptions for non-HTML responses were not relying on the PHP ``display_errors`` setting.

See the repo's
`CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_
Expand Down
Loading