Skip to content

Commit

Permalink
check temp path before deleting files in destructor
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdruid committed Dec 3, 2024
1 parent 1a4fffe commit 7e7c5cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/InterventionBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ public function __destruct()
$this->image->destroy();
}
// remove our temp file if it exists
if (file_exists($this->getTempPath() ?? '')) {
if ((strpos(basename($this->getTempPath()), 'interventionimage_') === 0) && file_exists($this->getTempPath() ?? '')) {
unlink($this->getTempPath() ?? '');
}
}
Expand Down

0 comments on commit 7e7c5cb

Please sign in to comment.