mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-18 23:08:46 +02:00
N°4360 Security hardening
This commit is contained in:
@@ -7351,6 +7351,11 @@ class AttributeImage extends AttributeBlob
|
||||
{
|
||||
if ($value instanceof ormDocument && !$value->IsEmpty())
|
||||
{
|
||||
if ($value->GetMimeType() === 'image/svg+xml') {
|
||||
// N°4360 SVG can contain JavaScript...
|
||||
return false;
|
||||
}
|
||||
|
||||
return ($value->GetMainMimeType() == 'image');
|
||||
}
|
||||
|
||||
|
||||
@@ -1955,7 +1955,16 @@ abstract class DBObject implements iDisplay
|
||||
}
|
||||
if (!$oAtt->CheckFormat($toCheck))
|
||||
{
|
||||
return "Wrong format [$toCheck]";
|
||||
$sErrorMessage = 'Wrong format';
|
||||
if ($oAtt instanceof AttributeDBFieldVoid) {
|
||||
$sErrorMessage .= " [$toCheck]";
|
||||
}
|
||||
if ($oAtt instanceof AttributeBlob) {
|
||||
/** @var $toCheck \ormDocument */
|
||||
$sErrorMessage .= ' ['.$toCheck->GetFileName().']';
|
||||
}
|
||||
|
||||
return $sErrorMessage;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user