mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
feat(presets): update Security.php to restrict additional dangerous functions
This commit is contained in:
@ -23,7 +23,15 @@ final class Security extends AbstractPreset
|
||||
'tempnam',
|
||||
'str_shuffle',
|
||||
'shuffle',
|
||||
'array_rand'
|
||||
'array_rand',
|
||||
'eval',
|
||||
'exec',
|
||||
'shell_exec',
|
||||
'system',
|
||||
'passthru',
|
||||
'create_function',
|
||||
'unserialize',
|
||||
'extract',
|
||||
])->not->toBeUsed();
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,14 +4,15 @@ use Pest\Expectation;
|
||||
|
||||
arch()->preset()->base()->ignoring([
|
||||
Expectation::class,
|
||||
'eval',
|
||||
'debug_backtrace',
|
||||
'usleep',
|
||||
]);
|
||||
|
||||
arch()->preset()->strict();
|
||||
|
||||
arch()->preset()->security();
|
||||
arch()->preset()->security()->ignoring([
|
||||
'eval',
|
||||
]);
|
||||
|
||||
arch('globals')
|
||||
->expect(['dd', 'dump', 'ray', 'die', 'var_dump', 'sleep'])
|
||||
|
||||
Reference in New Issue
Block a user