Skip to content

Commit e0b9bd6

Browse files
committed
fix(filefield): SQL single quote escaping
if the file field has a single quote in its name, the file is not added to Documents and the generated ticket may be missing information provided by the requester Signed-off-by: btry <tbugier@teclib.com>
1 parent fac8dfe commit e0b9bd6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

inc/form_answer.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ private function saveDocument(PluginFormcreatorForm $form, PluginFormcreatorQues
932932
$doc = new Document();
933933

934934
$file_data = [];
935-
$file_data["name"] = $form->getField('name'). ' - ' . $question->getField('name');
935+
$file_data["name"] = Toolbox::addslashes_deep($form->getField('name'). ' - ' . $question->getField('name'));
936936
$file_data["entities_id"] = isset($_SESSION['glpiactive_entity'])
937937
? $_SESSION['glpiactive_entity']
938938
: $form->getField('entities_id');

0 commit comments

Comments
 (0)