Revert "N°4360 Security hardening"

This reverts commit 8adf743cc7.

We will implement a different solution later (hopefully for 2.6.5 / 2.7.6 / 3.0.0 as well)
This commit is contained in:
Pierre Goiffon
2021-11-17 11:12:54 +01:00
parent 84426c6634
commit be633001a5
2 changed files with 1 additions and 15 deletions

View File

@@ -7351,11 +7351,6 @@ 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');
}

View File

@@ -1955,16 +1955,7 @@ abstract class DBObject implements iDisplay
}
if (!$oAtt->CheckFormat($toCheck))
{
$sErrorMessage = 'Wrong format';
if ($oAtt instanceof AttributeDBFieldVoid) {
$sErrorMessage .= " [$toCheck]";
}
if ($oAtt instanceof AttributeBlob) {
/** @var $toCheck \ormDocument */
$sErrorMessage .= ' ['.$toCheck->GetFileName().']';
}
return $sErrorMessage;
return "Wrong format [$toCheck]";
}
}
else