Skip to content

Commit 290ceae

Browse files
authored
Merge pull request #1843 from netalertx/next_release
Next release
2 parents 12794ee + 7795037 commit 290ceae

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎front/maintenance.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ function UploadConfig()
508508
appConfBase64 = btoa(appConf)
509509

510510
// import
511-
$.post('php/server/query_replace_config.php', { base64data: appConfBase64, fileName: "app.conf" }, function(msg) {
511+
$.post('php/server/query_replace_config.php', { base64data: appConfBase64, fileName: "app.conf", csrf_token: <?= json_encode(getCsrfToken()) ?> }, function(msg) {
512512
console.log(msg);
513513
// showMessage(msg);
514514
write_notification(`[Maintenance]: ${msg}`, 'interrupt');

‎front/php/server/query_replace_config.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
// Handle incoming requests
1818
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
1919

20+
requireCsrfToken();
21+
2022
$base64Data = $_POST['base64data'] ?? null;
2123
if (!$base64Data) {
2224
http_response_code(400);

‎front/workflowsCore.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ function saveWorkflows()
12311231
appConfBase64 = btoa(JSON.stringify(getWorkflowsJson()))
12321232

12331233
// import
1234-
$.post('php/server/query_replace_config.php', { base64data: appConfBase64, fileName: "workflows.json" })
1234+
$.post('php/server/query_replace_config.php', { base64data: appConfBase64, fileName: "workflows.json", csrf_token: <?= json_encode(getCsrfToken()) ?> })
12351235
.done(function(msg) {
12361236
console.log(msg);
12371237
write_notification(`[WF]: ${msg}`, 'interrupt');

0 commit comments

Comments
 (0)