Improvements for host selection, store ftn message in utf8

This commit is contained in:
Deon George
2021-07-05 23:17:00 +10:00
parent 5c5df12816
commit fe2784f98f
3 changed files with 11 additions and 9 deletions

View File

@@ -203,6 +203,8 @@ class Message extends FTNBase
case 'msgid': return $this->kludge->get('msgid');
case 'message':
return utf8_decode($this->{$key});
case 'subject':
case 'user_to':
case 'user_from':
@@ -374,7 +376,7 @@ class Message extends FTNBase
* Anything after the origin line is also kludge data.
*/
if ($y = strpos($v,"\r * Origin: ")) {
$this->message .= substr($v,$x+1,$y-$x-1);
$this->message .= utf8_encode(substr($v,$x+1,$y-$x-1));
$this->parseOrigin(substr($v,$y));
// If this is netmail, the FQFA will have been set by the INTL line, we can skip the rest of this
@@ -400,7 +402,7 @@ class Message extends FTNBase
// The message is the rest?
} elseif (strlen($v) > $x+1) {
$this->message .= substr($v,$x+1);
$this->message .= utf8_encode(substr($v,$x+1));
}
$v = substr($v,0,$x+1);
@@ -506,6 +508,7 @@ class Message extends FTNBase
* Translate the string into something printable via the web
*
* @param string $string
* @param array $skip
* @return string
*/
public static function tr(string $string,array $skip=[0x0a,0x0d]): string