mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +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',
|
'tempnam',
|
||||||
'str_shuffle',
|
'str_shuffle',
|
||||||
'shuffle',
|
'shuffle',
|
||||||
'array_rand'
|
'array_rand',
|
||||||
|
'eval',
|
||||||
|
'exec',
|
||||||
|
'shell_exec',
|
||||||
|
'system',
|
||||||
|
'passthru',
|
||||||
|
'create_function',
|
||||||
|
'unserialize',
|
||||||
|
'extract',
|
||||||
])->not->toBeUsed();
|
])->not->toBeUsed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,14 +4,15 @@ use Pest\Expectation;
|
|||||||
|
|
||||||
arch()->preset()->base()->ignoring([
|
arch()->preset()->base()->ignoring([
|
||||||
Expectation::class,
|
Expectation::class,
|
||||||
'eval',
|
|
||||||
'debug_backtrace',
|
'debug_backtrace',
|
||||||
'usleep',
|
'usleep',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
arch()->preset()->strict();
|
arch()->preset()->strict();
|
||||||
|
|
||||||
arch()->preset()->security();
|
arch()->preset()->security()->ignoring([
|
||||||
|
'eval',
|
||||||
|
]);
|
||||||
|
|
||||||
arch('globals')
|
arch('globals')
|
||||||
->expect(['dd', 'dump', 'ray', 'die', 'var_dump', 'sleep'])
|
->expect(['dd', 'dump', 'ray', 'die', 'var_dump', 'sleep'])
|
||||||
|
|||||||
Reference in New Issue
Block a user