Skip to content

Commit 2c1b1b6

Browse files
committed
bug #62 Dont allow unserializing classes with a destructor - security-acl (jderusse)
This PR was merged into the 3.0-dev branch. Discussion ---------- Dont allow unserializing classes with a destructor - security-acl Prevent destructors with side-effects from being unserialized Commits ------- 28638eb Dont allow unserializing classes with a destructor - security-acl
2 parents d22a7c4 + 28638eb commit 2c1b1b6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Domain/FieldEntry.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ public function serialize()
6767
public function unserialize($serialized)
6868
{
6969
list($this->field, $parentStr) = unserialize($serialized);
70+
if (!\is_string($parentStr)) {
71+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
72+
}
7073
parent::unserialize($parentStr);
7174
}
7275
}

0 commit comments

Comments
 (0)