FE: Hardening

This commit is contained in:
jokob-sk committed 2026-10-13 16:54:18 +11:00
1 parent 90f2714639
commit 7795037843
3 files changed
+4 -2

No files matched your search

+1 -1
View File
@@ -508,7 +508,7 @@ function UploadConfig()
appConfBase64 = btoa(appConf)
// import
$.post('php/server/query_replace_config.php', { base64data: appConfBase64, fileName: "app.conf" }, function(msg) {
$.post('php/server/query_replace_config.php', { base64data: appConfBase64, fileName: "app.conf", csrf_token: <?= json_encode(getCsrfToken()) ?> }, function(msg) {
console.log(msg);
// showMessage(msg);
write_notification(`[Maintenance]: ${msg}`, 'interrupt');
@@ -17,6 +17,8 @@ global $configFolderPath;
// Handle incoming requests
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
requireCsrfToken();
$base64Data = $_POST['base64data'] ?? null;
if (!$base64Data) {
http_response_code(400);
+1 -1
View File
@@ -1231,7 +1231,7 @@ function saveWorkflows()
appConfBase64 = btoa(JSON.stringify(getWorkflowsJson()))
// import
$.post('php/server/query_replace_config.php', { base64data: appConfBase64, fileName: "workflows.json" })
$.post('php/server/query_replace_config.php', { base64data: appConfBase64, fileName: "workflows.json", csrf_token: <?= json_encode(getCsrfToken()) ?> })
.done(function(msg) {
console.log(msg);
write_notification(`[WF]: ${msg}`, 'interrupt');