mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
🤖 Auto commit for release 'develop' on 2025-09-07
This commit is contained in:
@@ -128,6 +128,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
public function saveAttachmentFromApi(Attachment $attachment, string $content): bool
|
||||
{
|
||||
Log::debug(sprintf('Now in %s', __METHOD__));
|
||||
|
||||
try {
|
||||
$resource = tmpfile();
|
||||
} catch (FilesystemException $e) {
|
||||
@@ -144,6 +145,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
|
||||
$path = stream_get_meta_data($resource)['uri'];
|
||||
Log::debug(sprintf('Path is %s', $path));
|
||||
|
||||
try {
|
||||
$result = fwrite($resource, $content);
|
||||
} catch (FilesystemException $e) {
|
||||
@@ -152,6 +154,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
return false;
|
||||
}
|
||||
Log::debug(sprintf('Wrote %d bytes to temp file.', $result));
|
||||
|
||||
try {
|
||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||
} catch (FileinfoException $e) {
|
||||
@@ -175,7 +178,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
$this->uploadDisk->put($file, $content);
|
||||
|
||||
// update attachment.
|
||||
$attachment->md5 = md5_file($path);
|
||||
$attachment->md5 = md5_file($path);
|
||||
$attachment->mime = $mime;
|
||||
$attachment->size = strlen($content);
|
||||
$attachment->uploaded = true;
|
||||
@@ -237,7 +240,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
$attachment = new Attachment(); // create Attachment object.
|
||||
$attachment->user()->associate($user);
|
||||
$attachment->attachable()->associate($model);
|
||||
$attachment->md5 = md5_file($file->getRealPath());
|
||||
$attachment->md5 = md5_file($file->getRealPath());
|
||||
$attachment->filename = $file->getClientOriginalName();
|
||||
$attachment->mime = $file->getMimeType();
|
||||
$attachment->size = $file->getSize();
|
||||
|
@@ -116,7 +116,7 @@ class NetWorth implements NetWorthInterface
|
||||
return $netWorth;
|
||||
}
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void
|
||||
public function setUser(Authenticatable|User|null $user): void
|
||||
{
|
||||
if (!$user instanceof User) {
|
||||
return;
|
||||
|
@@ -46,7 +46,7 @@ interface NetWorthInterface
|
||||
*/
|
||||
public function byAccounts(Collection $accounts, Carbon $date): array;
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void;
|
||||
public function setUser(Authenticatable|User|null $user): void;
|
||||
|
||||
public function setUserGroup(UserGroup $userGroup): void;
|
||||
|
||||
|
Reference in New Issue
Block a user