Skip to content

Commit 49196c0

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 77c6e17 + cb8ba3b commit 49196c0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

DataCollector/DumpDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public function __wakeup()
179179
$fileLinkFormat = array_pop($this->data);
180180
$this->dataCount = \count($this->data);
181181

182-
self::__construct($this->stopwatch, $fileLinkFormat, $charset);
182+
self::__construct($this->stopwatch, \is_string($fileLinkFormat) || $fileLinkFormat instanceof FileLinkFormatter ? $fileLinkFormat : null, \is_string($charset) ? $charset : null);
183183
}
184184

185185
public function getDumpsCount(): int

Kernel.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,10 @@ public function __sleep()
865865

866866
public function __wakeup()
867867
{
868+
if (\is_object($this->environment) || \is_object($this->debug)) {
869+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
870+
}
871+
868872
$this->__construct($this->environment, $this->debug);
869873
}
870874
}

0 commit comments

Comments
 (0)