Merge remote-tracking branch 'origin/support/2.5' into release/2.6

This commit is contained in:
Pierre Goiffon
2019-01-09 17:24:54 +01:00
3 changed files with 17 additions and 1 deletions

View File

@@ -184,7 +184,15 @@ EOF
$sFile = utils::ReadParam('file', '', false, 'raw_data');
$oBackup = new DBBackupScheduled();
$sBackupDir = APPROOT.'data/backups/';
$oBackup->DownloadBackup($sBackupDir.$sFile);
$sPathNoDotDotPattern = '/^((?!\/\.\.\/).)*$/';
if(preg_match($sPathNoDotDotPattern, $sBackupDir.$sFile) == 1)
{
$oBackup->DownloadBackup($sBackupDir.$sFile);
}
else
{
throw new InvalidParameterException('Invalid file path');
}
break;
}
}