Skip to content

Commit

Permalink
Check _temp_tarname before deleting temp file in destructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdruid committed Feb 1, 2021
1 parent 19bb8e9 commit ae2bc12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Archive/Tar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit ae2bc12

Please # to comment.