From ae2bc12e0e4dcc47d793af1d24bce27b866196e5 Mon Sep 17 00:00:00 2001 From: mcdruid Date: Mon, 1 Feb 2021 16:16:27 +0000 Subject: [PATCH] Check _temp_tarname before deleting temp file in destructor. --- Archive/Tar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Archive/Tar.php b/Archive/Tar.php index 76771d5..8a2d2db 100644 --- a/Archive/Tar.php +++ b/Archive/Tar.php @@ -257,7 +257,7 @@ public function __destruct() { $this->_close(); // ----- Look for a local copy to delete - if ($this->_temp_tarname != '') { + if ($this->_temp_tarname != '' && (bool) preg_match('/^tar[[:alnum:]]*\.tmp$/', $this->_temp_tarname)) { @unlink($this->_temp_tarname); } }