Skip to content

Commit

Permalink
Preserve extension on files from HTTP PUT.
Browse files Browse the repository at this point in the history
  • Loading branch information
zackgalbreath committed Dec 12, 2014
1 parent 4458c51 commit b572257
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cdash/do_submit.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,10 @@ function put_submit_file()
// Begin writing this file to the backup directory.
global $CDASH_BACKUP_DIRECTORY;
$uploadDir = $CDASH_BACKUP_DIRECTORY;
$filename = $uploadDir . "/" . $buildfile->BuildId . "_" . $buildfile->md5;
$ext = pathinfo($buildfile->Filename, PATHINFO_EXTENSION);
$filename = $uploadDir . "/" . $buildfile->BuildId . "_" . $buildfile->md5
. ".$ext";

if(!$handle = fopen($filename, 'w'))
{
$response_array['status'] = 1;
Expand Down

0 comments on commit b572257

Please sign in to comment.