[Attachment] Sometimes we can't provide download of original file

This commit is contained in:
2021-08-12 04:58:34 +01:00
committed by Hugo Sales
parent 4cc4523632
commit 968e3431e1
2 changed files with 17 additions and 5 deletions

View File

@@ -133,7 +133,7 @@ class GSFile
}
return $response;
} else {
throw new ServerException(_m('This attachment is not stored locally'));
throw new ServerException(_m('This attachment is not stored locally.'));
}
}
@@ -186,8 +186,10 @@ class GSFile
*/
public static function getAttachmentFileInfo(int $id): array
{
$res = self::getFileInfo($id);
$res['filepath'] = Common::config('attachments', 'dir') . $res['filename'];
$res = self::getFileInfo($id);
if (!is_null($res['filename'])) {
$res['filepath'] = Common::config('attachments', 'dir') . $res['filename'];
}
return $res;
}