Process TIC files even if they omit the size attribute
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 34s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m34s
Create Docker Image / Final Docker Image Manifest (push) Successful in 8s

This commit is contained in:
Deon George 2024-11-19 16:37:29 +09:30
parent 2316663dac
commit dacd8be4c2

View File

@ -135,7 +135,7 @@ class Tic extends FTNBase
*/ */
public function isNodelist(): bool public function isNodelist(): bool
{ {
Log::critical(sprintf('%s:D fo_nodelist_file_area [%d], fo_filearea_domain_filearea_id [%d], regex [%s] name [%s]', Log::info(sprintf('%s:D fo_nodelist_file_area [%d], fo_filearea_domain_filearea_id [%d], regex [%s] name [%s]',
self::LOGKEY, self::LOGKEY,
$this->file->nodelist_filearea_id, $this->file->nodelist_filearea_id,
$this->file->filearea->domain->filearea_id, $this->file->filearea->domain->filearea_id,
@ -347,7 +347,7 @@ class Tic extends FTNBase
// @todo Add notification back to the system if no replaces line and the file already exists // @todo Add notification back to the system if no replaces line and the file already exists
// Validate Size // Validate Size
if ($this->file->size !== ($y=$fs->size($file))) if ((! is_null($this->file->size)) && ($this->file->size !== ($y=$fs->size($file))))
throw new SizeMismatchException(sprintf('TIC file size [%d] doesnt match file [%s] (%d)',$this->file->size,$fs->path($rel_path_name),$y)); throw new SizeMismatchException(sprintf('TIC file size [%d] doesnt match file [%s] (%d)',$this->file->size,$fs->path($rel_path_name),$y));
// Validate Password // Validate Password
@ -367,6 +367,10 @@ class Tic extends FTNBase
if (! $this->file->datetime) if (! $this->file->datetime)
$this->file->datetime = Carbon::createFromTimestamp($fs->lastModified($file)); $this->file->datetime = Carbon::createFromTimestamp($fs->lastModified($file));
// If the file size was omitted, we'll use the file's size
if (is_null($this->file->size))
$this->file->size = $fs->size($file);
$this->file->src_file = $file; $this->file->src_file = $file;
$this->file->recv_tic = $filename; $this->file->recv_tic = $filename;