mirror of https://github.com/MISP/MISP
fix: [internal] loading a missing proposal attachment leads to an exception
- should be silently logged and notice error sentpull/6262/head
parent
c3d6054409
commit
40c43462a0
|
@ -394,10 +394,19 @@ class ShadowAttribute extends AppModel
|
|||
return in_array($type, $this->zippedDefinitions) || in_array($type, $this->uploadDefinitions);
|
||||
}
|
||||
|
||||
public function base64EncodeAttachment($attribute)
|
||||
public function base64EncodeAttachment(array $attribute)
|
||||
{
|
||||
$content = $this->loadAttachmentTool()->getShadowContent($attribute['event_id'], $attribute['id']);
|
||||
return base64_encode($content);
|
||||
try {
|
||||
return base64_encode($this->getAttachment($attribute));
|
||||
} catch (NotFoundException $e) {
|
||||
$this->log($e->getMessage(), LOG_NOTICE);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
public function getAttachment($attribute, $path_suffix='')
|
||||
{
|
||||
return $this->loadAttachmentTool()->getShadowContent($attribute['event_id'], $attribute['id'], $path_suffix);
|
||||
}
|
||||
|
||||
public function saveBase64EncodedAttachment($attribute)
|
||||
|
|
Loading…
Reference in New Issue