Skip to content

Commit eea2fb8

Browse files
Merge branch '5.1' into 5.2
* 5.1: Dont allow unserializing classes with a destructor Dont allow unserializing classes with a destructor - 4.4 [Cache] fix possible collision when writing tmp file in filesystem adapter a colon followed by spaces exclusively separates mapping keys and values Contracts: Remove ellipsis fix handling float-like key attribute values Fix missing BCC recipients in SES bridge Dont allow unserializing classes with a destructor - 5.1
2 parents 681420a + 99aa305 commit eea2fb8

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

Chunk/ErrorChunk.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,16 @@ public function didThrow(bool $didThrow = null): bool
120120
return $this->didThrow;
121121
}
122122

123+
public function __sleep()
124+
{
125+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
126+
}
127+
128+
public function __wakeup()
129+
{
130+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
131+
}
132+
123133
public function __destruct()
124134
{
125135
if (!$this->didThrow) {

CurlHttpClient.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,16 @@ public function reset()
367367
}
368368
}
369369

370+
public function __sleep()
371+
{
372+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
373+
}
374+
375+
public function __wakeup()
376+
{
377+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
378+
}
379+
370380
public function __destruct()
371381
{
372382
$this->reset();

HttplugClient.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,16 @@ public function createUri($uri): UriInterface
218218
throw new \LogicException(sprintf('You cannot use "%s()" as the "nyholm/psr7" package is not installed. Try running "composer require nyholm/psr7".', __METHOD__));
219219
}
220220

221+
public function __sleep()
222+
{
223+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
224+
}
225+
226+
public function __wakeup()
227+
{
228+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
229+
}
230+
221231
public function __destruct()
222232
{
223233
$this->wait();

Response/AmpResponse.php

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

145+
public function __sleep()
146+
{
147+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
148+
}
149+
150+
public function __wakeup()
151+
{
152+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
153+
}
154+
145155
public function __destruct()
146156
{
147157
try {

0 commit comments

Comments
 (0)