Compare commits

...

2 Commits

Author SHA1 Message Date
da7bfcc4e2 Fix for invalid-zone validation comparing a string with an int
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 38s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m44s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s
2024-05-21 21:57:37 +10:00
caf590f2e9 Fix missed Notification using old Message::class 2024-05-21 21:57:37 +10:00
3 changed files with 16 additions and 21 deletions

View File

@ -307,10 +307,10 @@ class Message extends FTNBase
switch ($key) {
// From Addresses
case 'fz': return Arr::get($this->src,'z');
case 'fn': return ($x=$this->src) ? Arr::get($x,'n') : Arr::get($this->header,'onet');
case 'ff': return ($x=$this->src) ? Arr::get($x,'f') : Arr::get($this->header,'onode');
case 'fp': return $this->mo->kludges->get('FMPT:') ?: Arr::get($this->src,'p',Arr::get($this->header,'opoint',0));
case 'fz': return (int)Arr::get($this->src,'z');
case 'fn': return (int)($x=$this->src) ? Arr::get($x,'n') : Arr::get($this->header,'onet');
case 'ff': return (int)($x=$this->src) ? Arr::get($x,'f') : Arr::get($this->header,'onode');
case 'fp': return (int)$this->mo->kludges->get('FMPT:') ?: Arr::get($this->src,'p',Arr::get($this->header,'opoint',0));
case 'fd': return Arr::get($this->src,'d');
case 'fzone':
@ -341,10 +341,10 @@ class Message extends FTNBase
// To Addresses
// Echomail doesnt have a zone, so we'll use the source zone
case 'tz': return Arr::get($this->isEchomail() ? $this->src : $this->dst,'z');
case 'tn': return Arr::get($this->header,'dnet');
case 'tf': return Arr::get($this->header,'dnode');
case 'tp': return $this->mo->kludges->get('TOPT:') ?: Arr::get($this->header,'dpoint',0);
case 'tz': return (int)Arr::get($this->isEchomail() ? $this->src : $this->dst,'z');
case 'tn': return (int)Arr::get($this->header,'dnet');
case 'tf': return (int)Arr::get($this->header,'dnode');
case 'tp': return (int)$this->mo->kludges->get('TOPT:') ?: Arr::get($this->header,'dpoint',0);
case 'tzone':
// Use the zone if this class was called with it.
@ -360,6 +360,7 @@ class Message extends FTNBase
return Zone::where('zone_id',$this->tz)
->where('default',TRUE)
->single();
case 'tdomain':
// We'll use the zone's domain if this method class was called with a zone
if ($this->zone && (($this->zone->domain->name === Arr::get($this->dst,'d')) || ! Arr::get($this->dst,'d')))

View File

@ -3,9 +3,7 @@
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Storage;
use App\Classes\File;
use App\Classes\FTN\Packet;
use App\Jobs\PacketProcess as Job;
use App\Models\Address;
@ -60,16 +58,13 @@ class PacketProcess extends Command
/**
* Execute the console command.
*
* @return void
* @throws \App\Exceptions\InvalidPacketException
* @return int|void
* @throws \Exception
*/
public function handle()
{
//$fs = Storage::disk(config('fido.local_disk'));
$rel_name = sprintf('%s/%s',config('fido.dir'),$this->argument('file'));
//$f = new File($fs->path($rel_name));
$m = [];
if ($this->argument('ftn')) {
$ao = Address::findFTN($this->argument('ftn'));
@ -84,6 +79,6 @@ class PacketProcess extends Command
Job::dispatchSync($rel_name,$ao->zone->domain,$this->option('dontqueue'));
return Command::SUCCESS;
return self::SUCCESS;
}
}

View File

@ -5,9 +5,8 @@ namespace App\Notifications\Netmails;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
use App\Classes\FTN\Message;
use App\Notifications\Netmails;
use App\Models\Netmail;
use App\Models\{Echomail,Netmail};
use App\Traits\{MessagePath,PageTemplate};
class EchomailBadAddress extends Netmails
@ -16,14 +15,14 @@ class EchomailBadAddress extends Netmails
private const LOGKEY = 'NBA';
private Message $mo;
private Echomail $mo;
/**
* Send a sysop a message if they give us a message with a bad address in it.
*
* @param Message $mo
* @param Echomail $mo
*/
public function __construct(Message $mo)
public function __construct(Echomail $mo)
{
parent::__construct();