Skip to content

Commit

Permalink
Use proper temporary directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Toflar committed Dec 1, 2021
1 parent 18f4145 commit df188ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion library/NotificationCenter/Gateway/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ protected function saveToFTP($strFileName, $strContent, $strStorageMode)
}

// Write content to temporary file
$objFile = new \File('system/tmp/' . md5(uniqid(mt_rand(), true)));
$objFile = new \File(sys_get_temp_dir() . '/' . md5(uniqid(mt_rand(), true)));
$objFile->write($strContent);
$objFile->close();

Expand Down
3 changes: 1 addition & 2 deletions library/NotificationCenter/Util/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ public static function getFileUploadPathForToken(array $file)
return null;
}

$tmpDir = 'system/tmp';
$filePath = $tmpDir . '/' . $file['name'];
$filePath = sys_get_temp_dir() . '/' . $file['name'];
\Files::getInstance()->move_uploaded_file($file['tmp_name'], $filePath);
\Files::getInstance()->chmod($filePath, $GLOBALS['TL_CONFIG']['defaultFileChmod']);

Expand Down

0 comments on commit df188ab

Please sign in to comment.