Skip to content

Commit d0f2e90

Browse files
committed
SUPP0RT-1066: Updated code documentation
1 parent 785acbd commit d0f2e90

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Helper/ArchiveHelper.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,11 @@ private function computeGetOrganizedFilename(string $filename, WebformSubmission
466466
$webformLabel = $submission->getWebform()->label();
467467
$submissionNumber = $submission->serial();
468468

469-
return substr_replace($filename, '-' . $webformLabel . '-' . $submissionNumber, strrpos($filename, '.' . $fileExtension), 0);
469+
// Find position of last occurrence of extension
470+
$position = strrpos($filename, '.' . $fileExtension);
471+
472+
// Inject the webform label and submission number at found position.
473+
return substr_replace($filename, '-' . $webformLabel . '-' . $submissionNumber, $position, 0);
470474
}
471475

472476
}

0 commit comments

Comments
 (0)