Skip to content

Commit 1451341

Browse files
author
Denis Brumann
committed
Conditionally add options to unserialize in PHP 7.0+.
1 parent 40ac080 commit 1451341

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

FormError.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ public function serialize()
185185
*/
186186
public function unserialize($serialized)
187187
{
188-
list($this->message, $this->messageTemplate, $this->messageParameters, $this->messagePluralization, $this->cause) = unserialize($serialized);
188+
if (PHP_VERSION_ID >= 70000) {
189+
list($this->message, $this->messageTemplate, $this->messageParameters, $this->messagePluralization, $this->cause) = unserialize($serialized, array('allowed_classes' => false));
190+
} else {
191+
list($this->message, $this->messageTemplate, $this->messageParameters, $this->messagePluralization, $this->cause) = unserialize($serialized);
192+
}
189193
}
190194
}

0 commit comments

Comments
 (0)