misc options

This commit is contained in:
2025-02-11 18:18:49 +01:00
parent 009b2b3c2f
commit 7517c9f924
2 changed files with 50 additions and 13 deletions

View File

@ -102,22 +102,21 @@ if ($preset && isset($PRESETS[$preset])) {
'--spoof-mac' => FILTER_VALIDATE_MAC,
'--badsum' => FILTER_VALIDATE_BOOLEAN,
// MISC:
// '6' => FILTER_VALIDATE_BOOLEAN,
// '-6' => FILTER_VALIDATE_BOOLEAN,
'-A' => FILTER_VALIDATE_BOOLEAN,
'--send-eth' => FILTER_VALIDATE_BOOLEAN,
'--send-ip' => FILTER_VALIDATE_BOOLEAN,
'--privileged' => FILTER_VALIDATE_BOOLEAN,
'--unprivileged' => FILTER_VALIDATE_BOOLEAN,
'--stylesheet' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $fileNameRegex]],
], false);
}
$inputs = array_merge($COMMONOPTIONS, $inputs);
$inputs['--stylesheet'] = "$BASEDIR/$STYLESHEETSDIR/{$inputs['--stylesheet']}?";
if ($name) $inputs['--stylesheet'] .= "name=$name";
$options = "";
foreach ($inputs as $option => $value) {
foreach (array_merge($COMMONOPTIONS, $inputs) as $option => $value) {
if (substr($option, 0, 1) == '-') {
if (is_null($value)) {
http_response_code(400);