Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a608793

Browse files
Merge branch '5.2' into 5.x
* 5.2: [Semaphore] Dont allow unserializing classes with a destructor
2 parents a176f87 + c6149d3 commit a608793

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Symfony/Component/Semaphore/Semaphore.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ public function __construct(Key $key, PersistingStoreInterface $store, float $tt
4848
$this->logger = new NullLogger();
4949
}
5050

51+
public function __sleep()
52+
{
53+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
54+
}
55+
56+
public function __wakeup()
57+
{
58+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
59+
}
60+
5161
/**
5262
* Automatically releases the underlying semaphore when the object is destructed.
5363
*/

0 commit comments

Comments
 (0)