This repository was archived by the owner on Oct 5, 2022. It is now read-only.
This repository was archived by the owner on Oct 5, 2022. It is now read-only.
PDO initialization unsafe #118
Open
Description
Usually i call this in a common file like a index or header
$psl = new phpSec\Core();
$psl['store'] = $psl->share(function($psl) {
$dsn = 'mysql:' .
'dbname=test;' .
'table=phpsec;' .
'host=localhost;' .
'username=databaseusername;' .
'password=databasepassword';
return new phpSec\Store\Pdo($dsn, $psl);
});
Definind the $dsn in such a major file seems really unsafe and unconfortable as well.
We need something like
$dsn = 'mysql:' .
'dbname=test;' .
'table=phpsec;' .
'host=localhost;' .
'username=databaseusername;' .
'password=databasepassword';
$psl = new phpSec\Core();
$psl['store'] = $psl->share(function($dsn, $psl) {
return new phpSec\Store\Pdo($dsn, $psl);
});
Any ideas?