mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
Add allowed commands
This commit is contained in:
parent
357dfc53c9
commit
648c43cc7f
@ -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');
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user