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

Bug: PHP Fatal error: Uncaught ErrorException: Undefined property: Config\\Exceptions::$sensitiveDataInTrace #5342

Closed
fedeburo opened this issue Nov 17, 2021 · 2 comments
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@fedeburo
Copy link
Contributor

PHP Version

7.4

CodeIgniter4 Version

4.1.5

Which operating systems have you tested for this bug?

Windows

Which server did you use?

apache

Database

No response

What happened?

Hi everyone. I am having problems to visualize correctly the errors in "development" mode in my local env. Every time there is an error, it always end in the same blank page with the following sentences:

PHP Fatal error: Uncaught ErrorException: Undefined property: Config\Exceptions::$sensitiveDataInTrace in ........

Looking at the code and at different versions that you had released, i notice that there is a change on system/Debug/Exceptions.php, spcecially in the commit: 1cbdeac, on lines 244 - 250, where it is changed the way that is compared the way that is compared the variable $sensitiveDataInTrace

if (! empty($this->config->sensitiveDataInTrace)) {
to

if ($this->config->sensitiveDataInTrace !== []) {

It seems that this comparison is causing errors, and CodeIgniter is not showing the correct error in the usual way that it was shown in older versions.

I tried to downgrade codeigniter to version 4.1.4, and in this version, errors are shown correctly.

I wait for your answer, thanks!

Steps to Reproduce

Error on local, execute in page.

Expected Output

It is excpected that CodeIgniter show the correct error in the way that CodeIgniter always shows the error

Anything else?

No response

@fedeburo fedeburo added the bug Verified issues on the current code behavior or pull requests that will fix them label Nov 17, 2021
@kenjis
Copy link
Member

kenjis commented Nov 17, 2021

@kenjis kenjis closed this as completed Nov 17, 2021
@kenjis
Copy link
Member

kenjis commented Nov 17, 2021

Workaround:
Add the property $sensitiveDataInTrace in app/Config/Exceptions.php.

public $sensitiveDataInTrace = [];

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

No branches or pull requests

2 participants