Skip to content

Commit f3f0fe5

Browse files
committed
Dont allow unserializing classes with a destructor - 5.1
1 parent 9287d86 commit f3f0fe5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Response/AmpResponse.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,16 @@ public function getInfo(string $type = null)
109109
return null !== $type ? $this->info[$type] ?? null : $this->info;
110110
}
111111

112+
public function __sleep()
113+
{
114+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
115+
}
116+
117+
public function __wakeup()
118+
{
119+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
120+
}
121+
112122
public function __destruct()
113123
{
114124
try {

0 commit comments

Comments
 (0)