Skip to content

Commit 3ee8304

Browse files
committed
Dont allow unserializing classes with a destructor
1 parent 81b62bd commit 3ee8304

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Loader/Configurator/AbstractConfigurator.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ public function __call($method, $args)
3434
throw new \BadMethodCallException(sprintf('Call to undefined method "%s::%s()".', static::class, $method));
3535
}
3636

37+
public function __sleep()
38+
{
39+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
40+
}
41+
42+
public function __wakeup()
43+
{
44+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
45+
}
46+
3747
/**
3848
* Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value.
3949
*

0 commit comments

Comments
 (0)