Skip to content

Instantly share code, notes, and snippets.

@gwillem
Created February 14, 2022 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gwillem/61f494220f04d30111c94b11615f9285 to your computer and use it in GitHub Desktop.
Save gwillem/61f494220f04d30111c94b11615f9285 to your computer and use it in GitHub Desktop.
MDVA-43395_EE_2.4.3-p1_v1.patch
diff --git a/app/code/Magento/Email/Model/Template/Filter.php b/app/code/Magento/Email/Model/Template/Filter.php
index 1a7c3683820a..586cb485ee1f 100644
--- a/app/code/Magento/Email/Model/Template/Filter.php
+++ b/app/code/Magento/Email/Model/Template/Filter.php
@@ -618,6 +618,12 @@ public function transDirective($construction)
}
$text = __($text, $params)->render();
+
+ $pattern = '/{{.*?}}/';
+ do {
+ $text = preg_replace($pattern, '', (string)$text);
+ } while (preg_match($pattern, $text));
+
return $this->applyModifiers($text, $modifiers);
}
diff --git a/lib/internal/Magento/Framework/Filter/DirectiveProcessor/VarDirective.php b/lib/internal/Magento/Framework/Filter/DirectiveProcessor/VarDirective.php
index f2fe398c3848..78034d70ba51 100644
--- a/lib/internal/Magento/Framework/Filter/DirectiveProcessor/VarDirective.php
+++ b/lib/internal/Magento/Framework/Filter/DirectiveProcessor/VarDirective.php
@@ -55,6 +55,11 @@ public function process(array $construction, Template $filter, array $templateVa
$result = $this->filterApplier->applyFromRawParam($construction['filters'], $result);
}
+ $pattern = '/{{.*?}}/';
+ do {
+ $result = preg_replace($pattern, '', (string)$result);
+ } while (preg_match($pattern, $result));
+
return $result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment