Skip to content

Commit cb694db

Browse files
committed
Dont allow unserializing classes with a destructor - 5.1
1 parent aa8d71d commit cb694db

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

UnicodeString.php

+4
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ public function startsWith($prefix): bool
359359

360360
public function __wakeup()
361361
{
362+
if (!\is_string($this->string)) {
363+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
364+
}
365+
362366
normalizer_is_normalized($this->string) ?: $this->string = normalizer_normalize($this->string);
363367
}
364368

0 commit comments

Comments
 (0)