Skip to content

Commit 0ebf23f

Browse files
committed
Dont allow unserializing classes with a destructor
1 parent 4b671a1 commit 0ebf23f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Tests/Functional/app/AppKernel.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ public function __sleep(): array
8787

8888
public function __wakeup()
8989
{
90+
foreach ($this as $k => $v) {
91+
if (\is_object($v)) {
92+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
93+
}
94+
}
95+
9096
$this->__construct($this->varDir, $this->testCase, $this->rootConfig, $this->environment, $this->debug);
9197
}
9298

0 commit comments

Comments
 (0)