Skip to content

Commit

Permalink
refactor(filefield): less computation
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Mar 31, 2023
1 parent 902efa7 commit e32ab28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inc/field/filefield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function moveUploads() {
foreach ($this->uploads["_$key"] as $index => $document) {
$document = Toolbox::stripslashes_deep($document);
if (is_file(GLPI_TMP_DIR . '/' . $document)) {
$prefix = $this->uploads['_prefix_formcreator_field_' . $this->question->getID()][$index];
$prefix = $this->uploads['_prefix_' . $key][$index];
$answer_value[] = $this->saveDocument($document, $prefix);
}
$index++;
Expand Down Expand Up @@ -188,7 +188,7 @@ public function saveUploads($input) {
foreach ($input["_$key"] as $document) {
$document = Toolbox::stripslashes_deep($document);
if (is_file(GLPI_TMP_DIR . '/' . $document)) {
$prefix = $input['_prefix_formcreator_field_' . $this->question->getID()][$index];
$prefix = $input['_prefix_' . $key][$index];
$answer_value[] = $this->saveDocument($document, $prefix);
}
$index++;
Expand Down

0 comments on commit e32ab28

Please sign in to comment.