N°1933: Security hardening

This commit is contained in:
Stephen Abello
2019-01-14 11:57:16 +01:00
parent dfe81f6272
commit ed3fd851f1

View File

@@ -527,6 +527,8 @@ if (class_exists('ZipArchive')) // The setup must be able to start even if the "
* @param string $sFile
*/
public function DownloadBackup($sFile)
{
if (file_exists($sFile))
{
header('Content-Description: File Transfer');
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('Pragma: public');
header('Content-Length: '.filesize($sFile));
readfile($sFile);
readfile($sFile) ;
}
else
{
throw new InvalidParameterException('Invalid file path');
}
}
/**