yxcyxc
All checks were successful
Deploy / deploy-production (push) Has been skipped
Deploy / deploy-staging (push) Successful in 5s

This commit is contained in:
2026-05-11 00:55:59 +02:00
parent e92b5dea17
commit 9b2cf69d2c

View File

@@ -521,6 +521,22 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$submittedSetupSection = $currentSection; $submittedSetupSection = $currentSection;
} }
$payload = []; $payload = [];
$sectionFieldNames = match ($submittedSetupSection) {
'general' => array_map(static fn (array $field): string => (string) ($field['name'] ?? ''), $generalSetupFields),
'cron' => array_map(static fn (array $field): string => (string) ($field['name'] ?? ''), $cronSetupFields),
'custom' => array_map(static fn (array $field): string => (string) ($field['name'] ?? ''), $customSetupFields),
'database' => array_values(array_filter(array_merge(
array_map(static fn (array $field): string => (string) ($field['name'] ?? ''), $databaseSetupFields),
array_reduce($fieldsByDbGroup, static function (array $carry, array $groupFields): array {
foreach ($groupFields as $field) {
$carry[] = (string) ($field['name'] ?? '');
}
return $carry;
}, [])
), static fn (string $name): bool => $name !== '')),
default => [],
};
$sectionFieldLookup = array_fill_keys(array_values(array_filter($sectionFieldNames, static fn (string $name): bool => $name !== '')), true);
if ($isSchedulerAutosave || $isSchedulerTest) { if ($isSchedulerAutosave || $isSchedulerTest) {
if ($cronTaskDefinitions !== []) { if ($cronTaskDefinitions !== []) {
@@ -560,6 +576,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if ($name === '') { if ($name === '') {
continue; continue;
} }
if (!isset($sectionFieldLookup[$name])) {
continue;
}
$type = (string)($field['type'] ?? 'text'); $type = (string)($field['type'] ?? 'text');
$postKey = str_replace('.', '_', $name); $postKey = str_replace('.', '_', $name);
$value = $_POST[$postKey] ?? null; $value = $_POST[$postKey] ?? null;