mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-04 07:15:38 +08:00
Add allowed commands
This commit is contained in:
@@ -63,5 +63,13 @@ function f_passthru(string $cmd): bool
|
||||
return true;
|
||||
}
|
||||
|
||||
// allowed commands
|
||||
$allowed = ['cp', 'copy', 'xcopy'];
|
||||
foreach ($allowed as $a) {
|
||||
if (str_starts_with($cmd, $a)) {
|
||||
\f_passthru($cmd);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
throw new RuntimeException('Invalid tests');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user