Skip to content

Commit

Permalink
fix(filefield): SQL single quote escaping
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
btry committed Jul 18, 2018
1 parent fac8dfe commit e0b9bd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inc/form_answer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ private function saveDocument(PluginFormcreatorForm $form, PluginFormcreatorQues
$doc = new Document();

$file_data = [];
$file_data["name"] = $form->getField('name'). ' - ' . $question->getField('name');
$file_data["name"] = Toolbox::addslashes_deep($form->getField('name'). ' - ' . $question->getField('name'));
$file_data["entities_id"] = isset($_SESSION['glpiactive_entity'])
? $_SESSION['glpiactive_entity']
: $form->getField('entities_id');
Expand Down

0 comments on commit e0b9bd6

Please sign in to comment.