Fix packet password on exports, move __unserialize() to EncodeUTF8::decode

This commit is contained in:
Deon George
2021-09-08 22:07:00 +10:00
parent dbbfe46cb9
commit 03c4b87cdd
3 changed files with 42 additions and 42 deletions

View File

@@ -314,20 +314,15 @@ class Packet extends FTNBase implements \Iterator, \Countable
*/
public function __toString(): string
{
// Cache the packet creation
static $return = NULL;
$return = $this->createHeader();
if (is_null($return)) {
$return = $this->createHeader();
foreach ($this->messages as $o) {
if ($o->packed)
$return .= "\02\00".(string)$o;
}
$return .= "\00\00";
foreach ($this->messages as $o) {
if ($o->packed)
$return .= "\02\00".(string)$o;
}
$return .= "\00\00";
return $return;
}
@@ -337,7 +332,7 @@ class Packet extends FTNBase implements \Iterator, \Countable
private function createHeader(): string
{
try {
$a = pack(collect(self::v2header)->pluck(1)->join(''),
$a = pack(collect(self::v2header)->merge(['password' => [0x1a,'a8',8]])->pluck(1)->join(''),
$this->ff,
$this->tf,
Arr::get($this->header,'y'),