Issue #3036197 by dww: REST FileUploadResource::streamUploadData() can call fclose(FALSE)

8.7.x
Alex Pott 2019-03-01 00:41:34 +00:00
parent 0b6e897b34
commit 04343d7d91
No known key found for this signature in database
GPG Key ID: 31905460D4A69276
1 changed files with 2 additions and 2 deletions

View File

@ -325,8 +325,8 @@ class FileUploadResource extends ResourceBase {
fclose($temp_file); fclose($temp_file);
} }
else { else {
// Close the file streams. // Close the input file stream since we can't proceed with the upload.
fclose($temp_file); // Don't try to close $temp_file since it's FALSE at this point.
fclose($file_data); fclose($file_data);
$this->logger->error('Temporary file "%path" could not be opened for file upload', ['%path' => $temp_file_path]); $this->logger->error('Temporary file "%path" could not be opened for file upload', ['%path' => $temp_file_path]);
throw new HttpException(500, 'Temporary file could not be opened'); throw new HttpException(500, 'Temporary file could not be opened');