mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 01:28:47 +02:00
🔒 N°1795 prevent XSS on some fields
This commit is contained in:
@@ -2228,7 +2228,12 @@ EOF
|
||||
try
|
||||
{
|
||||
$token = utils::ReadParam('token', null);
|
||||
$aResult = array('code' => 'error', 'percentage' => 100, 'message' => "Export not found for token: '$token'"); // Fallback error, just in case
|
||||
$sTokenForDisplay = utils::HtmlEntities($token);
|
||||
$aResult = array( // Fallback error, just in case
|
||||
'code' => 'error',
|
||||
'percentage' => 100,
|
||||
'message' => "Export not found for token: '$sTokenForDisplay'",
|
||||
);
|
||||
$data = '';
|
||||
if ($token === null)
|
||||
{
|
||||
@@ -2303,11 +2308,11 @@ EOF
|
||||
$oPage->add(json_encode($aResult));
|
||||
} catch (BulkExportException $e)
|
||||
{
|
||||
$aResult = array('code' => 'error', 'percentage' => 100, 'message' => $e->GetLocalizedMessage());
|
||||
$aResult = array('code' => 'error', 'percentage' => 100, 'message' => utils::HtmlEntities($e->GetLocalizedMessage()));
|
||||
$oPage->add(json_encode($aResult));
|
||||
} catch (Exception $e)
|
||||
{
|
||||
$aResult = array('code' => 'error', 'percentage' => 100, 'message' => $e->getMessage());
|
||||
$aResult = array('code' => 'error', 'percentage' => 100, 'message' => utils::HtmlEntities($e->getMessage()));
|
||||
$oPage->add(json_encode($aResult));
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user