yxcyxc
This commit is contained in:
@@ -521,6 +521,22 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$submittedSetupSection = $currentSection;
|
||||
}
|
||||
$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 ($cronTaskDefinitions !== []) {
|
||||
@@ -560,6 +576,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if ($name === '') {
|
||||
continue;
|
||||
}
|
||||
if (!isset($sectionFieldLookup[$name])) {
|
||||
continue;
|
||||
}
|
||||
$type = (string)($field['type'] ?? 'text');
|
||||
$postKey = str_replace('.', '_', $name);
|
||||
$value = $_POST[$postKey] ?? null;
|
||||
|
||||
Reference in New Issue
Block a user