Skip to content

Commit 68c1306

Browse files
Merge branch '5.1' into 5.2
* 5.1: Dont allow unserializing classes with a destructor Dont allow unserializing classes with a destructor - 4.4 [Cache] fix possible collision when writing tmp file in filesystem adapter a colon followed by spaces exclusively separates mapping keys and values Contracts: Remove ellipsis fix handling float-like key attribute values Fix missing BCC recipients in SES bridge Dont allow unserializing classes with a destructor - 5.1
2 parents 0ff3bf7 + fdd3107 commit 68c1306

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

Pipes/UnixPipes.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ public function __construct(?bool $ttyMode, bool $ptyMode, $input, bool $haveRea
3535
parent::__construct($input);
3636
}
3737

38+
public function __sleep()
39+
{
40+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
41+
}
42+
43+
public function __wakeup()
44+
{
45+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
46+
}
47+
3848
public function __destruct()
3949
{
4050
$this->close();

Pipes/WindowsPipes.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,16 @@ public function __construct($input, bool $haveReadSupport)
8888
parent::__construct($input);
8989
}
9090

91+
public function __sleep()
92+
{
93+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
94+
}
95+
96+
public function __wakeup()
97+
{
98+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
99+
}
100+
91101
public function __destruct()
92102
{
93103
$this->close();

Process.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,16 @@ public static function fromShellCommandline(string $command, string $cwd = null,
195195
return $process;
196196
}
197197

198+
public function __sleep()
199+
{
200+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
201+
}
202+
203+
public function __wakeup()
204+
{
205+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
206+
}
207+
198208
public function __destruct()
199209
{
200210
if ($this->options['create_new_console'] ?? false) {

0 commit comments

Comments
 (0)