From 6c33582762527744064efea4db48b600fb052883 Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Fri, 9 Dec 2022 09:47:34 +0100 Subject: [PATCH] [ExpressionLanguage] Fix BC of cached SerializedParsedExpression containing GetAttrNode --- .../Component/ExpressionLanguage/Node/GetAttrNode.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Symfony/Component/ExpressionLanguage/Node/GetAttrNode.php b/src/Symfony/Component/ExpressionLanguage/Node/GetAttrNode.php index 1bad653328965..e9b10c3295d75 100644 --- a/src/Symfony/Component/ExpressionLanguage/Node/GetAttrNode.php +++ b/src/Symfony/Component/ExpressionLanguage/Node/GetAttrNode.php @@ -149,4 +149,15 @@ public function toArray() return [$this->nodes['node'], '[', $this->nodes['attribute'], ']']; } } + + /** + * Provides BC with instances serialized before v6.2 + */ + public function __unserialize(array $data): void + { + $this->nodes = $data['nodes']; + $this->attributes = $data['attributes']; + $this->attributes['is_null_coalesce'] ??= false; + $this->attributes['is_short_circuited'] ??= $data["\x00Symfony\Component\ExpressionLanguage\Node\GetAttrNode\x00isShortCircuited"] ?? false; + } }