🤖 Auto commit for release 'develop' on 2025-08-16

This commit is contained in:
JC5
2025-08-16 19:36:45 +02:00
parent eccc58e75a
commit 3409240a19
22 changed files with 96 additions and 73 deletions

View File

@@ -34,6 +34,7 @@ use Illuminate\Support\Facades\Storage;
use Safe\Exceptions\FileinfoException;
use Safe\Exceptions\FilesystemException;
use Safe\Exceptions\StringsException;
use function Safe\file_put_contents;
use function Safe\md5_file;
use function Safe\mime_content_type;
@@ -45,10 +46,11 @@ class ScansAttachments extends Command
protected $description = 'Rescan all attachments and re-set the correct MD5 hash and mime.';
protected $signature = 'firefly-iii:scan-attachments';
protected $signature = 'firefly-iii:scan-attachments';
/**
* Execute the console command.
*
* @throws FilesystemException
* @throws StringsException
* @throws FileinfoException
@@ -74,7 +76,7 @@ class ScansAttachments extends Command
Log::error(sprintf('Could not decrypt data of attachment #%d: %s', $attachment->id, $e->getMessage()));
$decryptedContent = $encryptedContent;
}
$tempFileName = tempnam(sys_get_temp_dir(), 'FireflyIII');
$tempFileName = tempnam(sys_get_temp_dir(), 'FireflyIII');
file_put_contents($tempFileName, $decryptedContent);
$attachment->md5 = (string)md5_file($tempFileName);
$attachment->mime = (string)mime_content_type($tempFileName);