N°1935: Security hardening

This commit is contained in:
Stephen Abello
2019-01-14 11:54:46 +01:00
parent 0bce9c78ea
commit dfe81f6272

View File

@@ -184,7 +184,7 @@ EOF
$sFile = utils::ReadParam('file', '', false, 'raw_data');
$oBackup = new DBBackupScheduled();
$sBackupDir = APPROOT.'data/backups/';
$sPathNoDotDotPattern = '/^((?!\/\.\.\/).)*$/';
$sPathNoDotDotPattern = "/^((?![\/\\\\]\.\.[\/\\\\]).)*$/";
if(preg_match($sPathNoDotDotPattern, $sBackupDir.$sFile) == 1)
{
$oBackup->DownloadBackup($sBackupDir.$sFile);