Skip to content

Commit 99aa305

Browse files
Merge branch '4.4' into 5.1
* 4.4: 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
2 parents 6ffdbdd + 256f405 commit 99aa305

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
@@ -116,6 +116,16 @@ public function didThrow(): bool
116116
return $this->didThrow;
117117
}
118118

119+
public function __sleep()
120+
{
121+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
122+
}
123+
124+
public function __wakeup()
125+
{
126+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
127+
}
128+
119129
public function __destruct()
120130
{
121131
if (!$this->didThrow) {

CurlHttpClient.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,16 @@ public function reset()
362362
}
363363
}
364364

365+
public function __sleep()
366+
{
367+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
368+
}
369+
370+
public function __wakeup()
371+
{
372+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
373+
}
374+
365375
public function __destruct()
366376
{
367377
$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/ResponseTrait.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,16 @@ public function toStream(bool $throw = true)
199199
return $stream;
200200
}
201201

202+
public function __sleep()
203+
{
204+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
205+
}
206+
207+
public function __wakeup()
208+
{
209+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
210+
}
211+
202212
/**
203213
* Closes the response and all its network handles.
204214
*/

0 commit comments

Comments
 (0)