mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-01 22:48:45 +02:00
Fix for potential XSS vulnerability on uploaded file names. To be further tested before retrofitting in branches.
SVN:trunk[3985]
This commit is contained in:
@@ -275,7 +275,7 @@ EOF
|
||||
{
|
||||
$iAttId = $oAttachment->GetKey();
|
||||
$oDoc = $oAttachment->Get('contents');
|
||||
$sFileName = $oDoc->GetFileName();
|
||||
$sFileName = htmlentities($oDoc->GetFileName(), ENT_QUOTES, 'UTF-8');
|
||||
$sIcon = utils::GetAbsoluteUrlAppRoot().AttachmentPlugIn::GetFileIcon($sFileName);
|
||||
$sPreview = $oDoc->IsPreviewAvailable() ? 'true' : 'false';
|
||||
$sDownloadLink = utils::GetAbsoluteUrlAppRoot().ATTACHMENT_DOWNLOAD_URL.$iAttId;
|
||||
@@ -303,7 +303,7 @@ EOF
|
||||
// Display them
|
||||
$iAttId = $oAttachment->GetKey();
|
||||
$oDoc = $oAttachment->Get('contents');
|
||||
$sFileName = $oDoc->GetFileName();
|
||||
$sFileName = htmlentities($oDoc->GetFileName(), ENT_QUOTES, 'UTF-8');
|
||||
$sIcon = utils::GetAbsoluteUrlAppRoot().AttachmentPlugIn::GetFileIcon($sFileName);
|
||||
$sDownloadLink = utils::GetAbsoluteUrlAppRoot().ATTACHMENT_DOWNLOAD_URL.$iAttId;
|
||||
$sPreview = $oDoc->IsPreviewAvailable() ? 'true' : 'false';
|
||||
@@ -439,7 +439,7 @@ EOF
|
||||
{
|
||||
$iAttId = $oAttachment->GetKey();
|
||||
$oDoc = $oAttachment->Get('contents');
|
||||
$sFileName = $oDoc->GetFileName();
|
||||
$sFileName = htmlentities($oDoc->GetFileName(), ENT_QUOTES, 'UTF-8');
|
||||
$sIcon = utils::GetAbsoluteUrlAppRoot().AttachmentPlugIn::GetFileIcon($sFileName);
|
||||
$sPreview = $oDoc->IsPreviewAvailable() ? 'true' : 'false';
|
||||
$sDownloadLink = utils::GetAbsoluteUrlAppRoot().ATTACHMENT_DOWNLOAD_URL.$iAttId;
|
||||
|
||||
Reference in New Issue
Block a user