Skip to content

Commit e9e8da4

Browse files
committed
fix(formanswer): temporary disable debug mode
prevents any PHP / SQL error to pollute JSON output
1 parent d86522b commit e9e8da4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ajax/formanswer.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
}
5555

5656
// Save form
57+
$backup_debug = $_SESSION['glpi_use_mode'];
58+
$_SESSION['glpi_use_mode'] = \Session::NORMAL_MODE;
5759
$formAnswer = PluginFormcreatorCommon::getFormAnswer();
5860
if ($formAnswer->add($_POST) === false) {
5961
http_response_code(400);
@@ -66,9 +68,11 @@
6668
'message' => $messages
6769
]);
6870
}
71+
$_SESSION['glpi_use_mode'] = $backup_debug;
6972
die();
7073
}
7174
$form->increaseUsageCount();
75+
$_SESSION['glpi_use_mode'] = $backup_debug;
7276

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

0 commit comments

Comments
 (0)