From c13eff907dca13a7e2ac5fa3e98ba88a9e7fa5c9 Mon Sep 17 00:00:00 2001 From: John Hunt Date: Tue, 14 Oct 2025 08:09:57 -0400 Subject: [PATCH] even with @, unlink still throws warnings if the file is not found, so we need to check file existence before trying to unlink it --- Spreadsheet/Excel/Writer/Worksheet.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spreadsheet/Excel/Writer/Worksheet.php b/Spreadsheet/Excel/Writer/Worksheet.php index e36a743..28c41e5 100644 --- a/Spreadsheet/Excel/Writer/Worksheet.php +++ b/Spreadsheet/Excel/Writer/Worksheet.php @@ -774,7 +774,7 @@ public function getData($cleanup = true) fclose($this->_filehandle); $this->_filehandle = ''; } - @unlink($this->_tmp_file); + file_exists($this->_tmp_file) && @unlink($this->_tmp_file); $this->_tmp_file = ''; $this->_using_tmpfile = false; $this->_datasize = 0;