Skip to content

Commit cb8ba3b

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 95be53e + 9579bea commit cb8ba3b

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
@@ -825,6 +825,10 @@ public function __sleep()
825825

826826
public function __wakeup()
827827
{
828+
if (\is_object($this->environment) || \is_object($this->debug)) {
829+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
830+
}
831+
828832
$this->__construct($this->environment, $this->debug);
829833
}
830834
}

0 commit comments

Comments
 (0)