We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c212995 commit 46d003bCopy full SHA for 46d003b
modules/file/src/Plugin/rest/resource/FileUploadResource.php
@@ -322,8 +322,8 @@ protected function streamUploadData() {
322
fclose($temp_file);
323
}
324
else {
325
- // Close the file streams.
326
- fclose($temp_file);
+ // Close the input file stream since we can't proceed with the upload.
+ // Don't try to close $temp_file since it's FALSE at this point.
327
fclose($file_data);
328
$this->logger->error('Temporary file "%path" could not be opened for file upload', ['%path' => $temp_file_path]);
329
throw new HttpException(500, 'Temporary file could not be opened');
0 commit comments