From 27fe3cd223838486cecb163302e5f88a8488915b Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 30 May 2024 20:14:50 +1000 Subject: [PATCH] Fix message processing when tag/tear lines dont start with double \r --- app/Classes/FTN/Message.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Classes/FTN/Message.php b/app/Classes/FTN/Message.php index abc5a9b..d195a98 100644 --- a/app/Classes/FTN/Message.php +++ b/app/Classes/FTN/Message.php @@ -734,10 +734,10 @@ class Message extends FTNBase $ptr_content_start = 0; // See if we have a tagline - if ($ptr_content_end=strrpos($content,"\r\r... ",$ptr_content_start)) { - $o->msg = substr($content,$ptr_content_start,$ptr_content_end); - $ptr_content_start = $ptr_content_end+6; + if ($ptr_content_end=strrpos($content,"\r... ",$ptr_content_start)) { + $o->msg = substr($content,$ptr_content_start,$ptr_content_end+1); + $ptr_content_start = $ptr_content_end+5; $ptr_content_end = strpos($content,"\r",$ptr_content_start); // If there is no terminating "\r", then that's it @@ -752,11 +752,11 @@ class Message extends FTNBase } // See if we have a tearline - if ($ptr_content_end=strrpos($content,"\r\r--- ",$ptr_content_start)) { + if ($ptr_content_end=strrpos($content,"\r--- ",$ptr_content_start)) { if (! $ptr_content_start) - $o->msg = substr($content,$ptr_content_start,$ptr_content_end); - $ptr_content_start = $ptr_content_end+6; + $o->msg = substr($content,$ptr_content_start,$ptr_content_end+1); + $ptr_content_start = $ptr_content_end+5; $ptr_content_end = strpos($content,"\r",$ptr_content_start); // If there is no terminating "\r", then that's it