Skip to content

Commit 44d40f4

Browse files
committed
Dont allow unserializing classes with a destructor
1 parent 351010a commit 44d40f4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Util/OrderedHashMapIterator.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,16 @@ public function __construct(array &$elements, array &$orderedKeys, array &$manag
7676
$this->managedCursors[$this->cursorId] = &$this->cursor;
7777
}
7878

79+
public function __sleep()
80+
{
81+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
82+
}
83+
84+
public function __wakeup()
85+
{
86+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
87+
}
88+
7989
/**
8090
* Removes the iterator's cursors from the managed cursors of the
8191
* corresponding {@link OrderedHashMap} instance.

0 commit comments

Comments
 (0)