Skip to content

Commit

Permalink
fix(form): fix anonymous file upload
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Mar 4, 2019
1 parent fcb357b commit a13ec8b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 1 addition & 0 deletions front/formdisplay.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@

// If user was not authenticated, remove temporary user
if ($_SESSION['glpiname'] == 'formcreator_temp_user') {
session_write_close();
unset($_SESSION['glpiname']);
}

Expand Down
4 changes: 0 additions & 4 deletions inc/fields/filefield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,11 @@ public function displayField($canEdit = true) {
if ($canEdit) {
$required = $this->isRequired() ? ' required' : '';

echo '<input type="hidden" class="form-control"
name="formcreator_field_' . $this->fields['id'] . '" value="" />' . PHP_EOL;

echo Html::file([
'name' => 'formcreator_field_' . $this->fields['id'],
'display' => false,
'multiple' => 'multiple',
]);

} else {
$doc = new Document();
$answer = $this->value;
Expand Down

0 comments on commit a13ec8b

Please sign in to comment.