mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 07:12:26 +02:00
N°1933: Security hardening
This commit is contained in:
@@ -527,6 +527,8 @@ if (class_exists('ZipArchive')) // The setup must be able to start even if the "
|
|||||||
* @param string $sFile
|
* @param string $sFile
|
||||||
*/
|
*/
|
||||||
public function DownloadBackup($sFile)
|
public function DownloadBackup($sFile)
|
||||||
|
{
|
||||||
|
if (file_exists($sFile))
|
||||||
{
|
{
|
||||||
header('Content-Description: File Transfer');
|
header('Content-Description: File Transfer');
|
||||||
header('Content-Type: multipart/x-zip');
|
header('Content-Type: multipart/x-zip');
|
||||||
@@ -535,7 +537,12 @@ if (class_exists('ZipArchive')) // The setup must be able to start even if the "
|
|||||||
header('Cache-Control: must-revalidate');
|
header('Cache-Control: must-revalidate');
|
||||||
header('Pragma: public');
|
header('Pragma: public');
|
||||||
header('Content-Length: '.filesize($sFile));
|
header('Content-Length: '.filesize($sFile));
|
||||||
readfile($sFile);
|
readfile($sFile) ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new InvalidParameterException('Invalid file path');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user