1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00

Fix temporary directory creation in secureUnzipDirectory function to ensure it only attempts to create if it doesn't already exist

This commit is contained in:
Daniel Neto 2025-07-31 07:17:00 -03:00
parent b926fcbdfc
commit c527e04aa1

View file

@ -184,8 +184,8 @@ function secureUnzipDirectory($zipFile, $destination) {
try { try {
// Create temporary directory for extraction // Create temporary directory for extraction
$tempDir = getTmpDir('/avideo_' . uniqid()); $tempDir = getTmpDir('avideo_' . uniqid());
if (!mkdir($tempDir, 0755, true)) { if (!is_dir($tempDir) && !mkdir($tempDir, 0755, true)) {
throw new Exception("Could not create temporary directory {$tempDir}"); throw new Exception("Could not create temporary directory {$tempDir}");
} }