Skip to content

Commit 09e4a2e

Browse files
jderussenicolas-grekas
authored andcommitted
Dont allow unserializing classes with a destructor - panter
1 parent b535e37 commit 09e4a2e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Client.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,16 @@ public function getBrowserManager(): BrowserManagerInterface
8585
return $this->browserManager;
8686
}
8787

88+
public function __sleep()
89+
{
90+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
91+
}
92+
93+
public function __wakeup()
94+
{
95+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
96+
}
97+
8898
public function __destruct()
8999
{
90100
$this->quit();

0 commit comments

Comments
 (0)