This commit is contained in:
devdatt 2025-12-23 14:31:15 +05:30
parent 297da3f311
commit 24be2b863b
1 changed files with 1 additions and 10 deletions

View File

@ -117,22 +117,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
];
$json = json_encode($new, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
if (file_put_contents($jsonFile, $json, LOCK_EX) === false) {
$errors[] = "Failed to write {$jsonFile}. Check permissions.";
} else {
$data = $new;
$success = 'Saved.';
foreach ($data as $block => &$fields) {
foreach ($fields as $key => $value) {
if (isset($_POST[$key])) {
$fields[$key] = trim($_POST[$key]);
}
}
}
unset($fields);
$netplan = [
'network' => [
'version' => 2,