Another fix for when packets contain binary messages with SOH chars.

This commit is contained in:
Deon George
2021-11-29 00:12:37 +11:00
parent 880ff81eff
commit a00534794e
3 changed files with 34 additions and 3 deletions

View File

@@ -692,9 +692,16 @@ class Message extends FTNBase
// If there are is a return in this middle of this line, that means the text message starts after the return
// If our message has started, then we'll assume the binary is part of the message.
if (strlen($this->message) || ($retpos != strlen($kl)-1)) {
if (strlen($this->message) || ($retpos !== strlen($kl)-1)) {
// If there was no return, its part of the message.
if ($retpos === FALSE) {
$this->message .= "\x01".$kl;
continue;
}
// Anything after the origin line is also kludge data.
if (($originpos = strpos($kl,"\r * Origin: "))) {
if ($originpos = strpos($kl,"\r * Origin: ")) {
if (! $this->message) {
$this->message .= substr($kl,$retpos+1,$originpos-$retpos-1);
$this->parseOrigin(substr($kl,$originpos+1));