Enable UTF8 encoding to/from as well in messages

This commit is contained in:
Deon George
2021-12-01 22:45:51 +11:00
parent f1780e61ea
commit 3a1c6d55c6
6 changed files with 51 additions and 33 deletions

View File

@@ -27,6 +27,8 @@ class Message extends FTNBase
private const LOGKEY = 'FM-';
private const cast_utf8 = [
'user_to',
'user_from',
'subject',
'message',
'message_src',
@@ -697,6 +699,7 @@ class Message extends FTNBase
// If there was no return, its part of the message.
if ($retpos === FALSE) {
$this->message .= "\x01".$kl;
continue;
}
@@ -704,20 +707,17 @@ class Message extends FTNBase
if ($originpos = strrpos($kl,"\r * Origin: ")) {
if (! $this->message) {
$this->message .= substr($kl,$retpos+1,$originpos-$retpos-1);
$this->parseOrigin(substr($kl,$originpos+1));
$kl = substr($kl,0,$retpos);
$this->message_src = substr($message, 0, $msgpos - strlen($kl) + 9);
} else {
$this->message .= "\x01".substr($kl,0,$originpos);
$this->parseOrigin(substr($kl,$originpos+1));
// Capture the raw message, in case we send it on
$this->message_src = substr($message, 0, $msgpos - strlen($kl) - 1 + $originpos + 12 + strlen($this->origin) + 1);
$kl = '';
$retpos = 0;
}
$this->parseOrigin(substr($kl,$originpos+1));
$this->message_src = substr($message, 0, $msgpos - (1+strlen($kl)) + $originpos + 12 + strlen($this->origin) + 1);
$kl = substr($kl,0,$retpos);
// If this is netmail, the FQFA will have been set by the INTL line, we can skip the rest of this
$matches = [];