From cab402d146dbdcf399d2a849f321757a51a32b4f Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 22 Aug 2021 11:00:41 +1000 Subject: [PATCH] Fix MSGID parsing when it has more than the FTN address --- app/Classes/FTN/Message.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Classes/FTN/Message.php b/app/Classes/FTN/Message.php index f2e0fcd..35085f5 100644 --- a/app/Classes/FTN/Message.php +++ b/app/Classes/FTN/Message.php @@ -740,8 +740,10 @@ class Message extends FTNBase // Work out our zone/point // http://ftsc.org/docs/fsc-0068.001 // MSGID should be the basis of the source, we'll overrite our src from origin if we have it - if ($this->msgid) - $this->src = Address::parseFTN(strstr($this->msgid,' ',TRUE)); + $m = []; + if ($this->msgid && preg_match('#([0-9]+:[0-9]+/[0-9]+)?\.?([0-9]+)?(@%s)?\ +#',$this->msgid,$m)) { + $this->src = Address::parseFTN($m[1].(isset($m[2]) ? '.'.$m[2] : '')); + } // Parse SEEN-BY if ($this->seenby->count())