Skip to content

Commit

Permalink
fix: exceptions for non-HTML responses should rely on display_errors …
Browse files Browse the repository at this point in the history
…setting
  • Loading branch information
michalsn committed Dec 9, 2024
1 parent 124a7e6 commit eae6010
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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
)
? $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

0 comments on commit eae6010

Please sign in to comment.