Skip to content

Commit 2227ea7

Browse files
committed
Image: attempt to serialize throws exception
1 parent f64f04d commit 2227ea7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Utils/Image.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,4 +607,13 @@ public function __clone()
607607
$this->setImageResource(imagecreatefromstring(ob_get_clean()));
608608
}
609609

610+
611+
/**
612+
* Prevents serialization.
613+
*/
614+
public function __sleep()
615+
{
616+
throw new Nette\NotSupportedException('You cannot serialize or unserialize ' . self::class . ' instances.');
617+
}
618+
610619
}

0 commit comments

Comments
 (0)