diff --git a/src/Entity/Message.php b/src/Entity/Message.php index 13c271e..11db87b 100644 --- a/src/Entity/Message.php +++ b/src/Entity/Message.php @@ -137,12 +137,33 @@ public function getUuid() { return $this->get('uuid')->value; } + /** + * Fix Incomplete Object PHP error caused by SA-CORE-2019-003 security release which + * uses unserialize($values, ['allowed_classes' => FALSE]); and thus turns the unserialized + * object into a "__PHP_Incomplete_Class" object. + * @param $object + * @return mixed + */ + private function fixIncompleteObject($object) { + if(is_object($object) && get_class($object) === "__PHP_Incomplete_Class") { + return ($object = unserialize(serialize($object))); + } + return $object; + } + /** * {@inheritdoc} */ public function getArguments() { $arguments = $this->get('arguments')->first(); - return $arguments ? $arguments->getValue() : []; + if ($arguments){ + $arguments = $arguments->getValue(); + foreach ($arguments as &$option) { + $option = $this->fixIncompleteObject($option); + } + return $arguments; + } + return []; } /**