PHP Version
8.1
CodeIgniter4 Version
4.3.6 and develop
CodeIgniter4 Installation Method
Git
Which operating systems have you tested for this bug?
macOS
Which server did you use?
cli-server (PHP built-in webserver)
Database
n/a
What happened?
1. APPPATH/Controllers/Home.php : 15 — App\Controllers\Home->f ( arguments ) $obj stdClass Object ( [password] => ****************** )
$array Array ( [password] => secret2 )
Steps to Reproduce
--- a/app/Config/Exceptions.php+++ b/app/Config/Exceptions.php@@ -49,7 +49,7 @@ class Exceptions extends BaseConfig
* In order to specify 2 levels, use "/" to separate.
* ex. ['server', 'setup/password', 'secret_token']
*/
- public array $sensitiveDataInTrace = [];+ public array $sensitiveDataInTrace = ['password'];
/**
* --------------------------------------------------------------------------
<?phpnamespaceApp\Controllers;
class Home extends BaseController
{
publicfunctionindex()
{
$obj = (object) [
'password' => 'secret1',
];
$array = ['password' => 'secret2'];
$this->f($obj, $array);
}
privatefunctionf($obj, $array)
{
foo($obj, $array);
}
}Expected Output
The array's password value should also be ******************.
Anything else?
If I set $sensitiveDataInTrace = ['file'], I get the following error:
Fatal error: Uncaught TypeError: Cannot assign string to property Config\Cache::$file of type array in .../CodeIgniter4/system/Debug/Exceptions.php on line 325
Ref #4550
PHP Version
8.1
CodeIgniter4 Version
4.3.6 and develop
CodeIgniter4 Installation Method
Git
Which operating systems have you tested for this bug?
macOS
Which server did you use?
cli-server (PHP built-in webserver)
Database
n/a
What happened?
Steps to Reproduce
Expected Output
The array's
passwordvalue should also be******************.Anything else?
If I set
$sensitiveDataInTrace = ['file'], I get the following error:Ref #4550