Skip to content

Commit

Permalink
fix(formanswer): temporary disable debug mode
Browse files Browse the repository at this point in the history
prevents any PHP / SQL error to pollute JSON output
  • Loading branch information
btry committed Nov 24, 2022
1 parent d86522b commit e9e8da4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ajax/formanswer.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
}

// Save form
$backup_debug = $_SESSION['glpi_use_mode'];
$_SESSION['glpi_use_mode'] = \Session::NORMAL_MODE;
$formAnswer = PluginFormcreatorCommon::getFormAnswer();
if ($formAnswer->add($_POST) === false) {
http_response_code(400);
Expand All @@ -66,9 +68,11 @@
'message' => $messages
]);
}
$_SESSION['glpi_use_mode'] = $backup_debug;
die();
}
$form->increaseUsageCount();
$_SESSION['glpi_use_mode'] = $backup_debug;

if ($_SESSION['glpiname'] == 'formcreator_temp_user') {
// Form was saved by an annymous user
Expand Down

0 comments on commit e9e8da4

Please sign in to comment.