1111use Magento \Cms \Block \Block ;
1212use Magento \Framework \App \Area ;
1313use Magento \Framework \App \Config \ScopeConfigInterface ;
14+ use Magento \Framework \App \ObjectManager ;
1415use Magento \Framework \App \State ;
1516use Magento \Framework \Css \PreProcessor \Adapter \CssInliner ;
1617use Magento \Framework \Escaper ;
3031use Magento \Framework \View \Element \AbstractBlock ;
3132use Magento \Framework \View \LayoutFactory ;
3233use Magento \Framework \View \LayoutInterface ;
34+ use Magento \Store \Model \Information as StoreInformation ;
3335use Magento \Store \Model \ScopeInterface ;
3436use Magento \Store \Model \StoreManagerInterface ;
3537use Magento \Variable \Model \Source \Variables ;
3638use Magento \Variable \Model \Variable ;
3739use Magento \Variable \Model \VariableFactory ;
3840use Psr \Log \LoggerInterface ;
39- use Magento \Store \Model \Information as StoreInformation ;
40- use Magento \Framework \App \ObjectManager ;
4141
4242/**
4343 * Core Email Template Filter Model
@@ -61,45 +61,33 @@ class Filter extends Template
6161 const TRANS_DIRECTIVE_REGEX = '/^\s*([ \'"])([^\1]*?)(?<! \\\)\1(\s.*)?$/si ' ;
6262
6363 /**
64- * Use absolute links flag
65- *
6664 * @var bool
6765 */
6866 protected $ _useAbsoluteLinks = false ;
6967
7068 /**
71- * Whether to allow SID in store directive: NO
72- *
7369 * @var bool
7470 * @deprecated SID is not being used as query parameter anymore.
7571 */
7672 protected $ _useSessionInUrl = false ;
7773
7874 /**
79- * Modifier Callbacks
80- *
8175 * @var array
8276 * @deprecated 101.0.4 Use the new Directive Processor interfaces
8377 */
8478 protected $ _modifiers = ['nl2br ' => '' ];
8579
8680 /**
87- * Whether template being filtered is child of another template
88- *
8981 * @var bool
9082 */
9183 private $ isChildTemplate = false ;
9284
9385 /**
94- * List of CSS files to inline
95- *
9686 * @var []
9787 */
9888 private $ inlineCssFiles = [];
9989
10090 /**
101- * Store id
102- *
10391 * @var int
10492 */
10593 protected $ _storeId ;
@@ -153,22 +141,16 @@ class Filter extends Template
153141 protected $ _layoutFactory ;
154142
155143 /**
156- * Setup callbacks for filters
157- *
158144 * @var ScopeConfigInterface
159145 */
160146 protected $ _scopeConfig ;
161147
162148 /**
163- * Layout directive params
164- *
165149 * @var array
166150 */
167151 protected $ _directiveParams ;
168152
169153 /**
170- * App state
171- *
172154 * @var State
173155 */
174156 protected $ _appState ;
@@ -591,6 +573,13 @@ public function storeDirective($construction)
591573 unset($ params ['url ' ]);
592574 }
593575
576+ /**
577+ * Pass extra parameter to distinguish stores urls for property Magento\Framework\Url $cacheUrl
578+ * in multi-store environment
579+ */
580+ $ this ->urlModel ->setScope ($ this ->_storeManager ->getStore ());
581+ $ params ['_escape_params ' ] = $ this ->_storeManager ->getStore ()->getCode ();
582+
594583 return $ this ->urlModel ->getUrl ($ path , $ params );
595584 }
596585
@@ -854,8 +843,8 @@ public function configDirective($construction)
854843 if ($ params ['path ' ] == $ this ->storeInformation ::XML_PATH_STORE_INFO_COUNTRY_CODE ) {
855844 $ configValue = $ storeInformationObj ->getData ('country ' );
856845 } elseif ($ params ['path ' ] == $ this ->storeInformation ::XML_PATH_STORE_INFO_REGION_CODE ) {
857- $ configValue = $ storeInformationObj ->getData ('region ' )?
858- $ storeInformationObj ->getData ('region ' ):
846+ $ configValue = $ storeInformationObj ->getData ('region ' ) ?
847+ $ storeInformationObj ->getData ('region ' ) :
859848 $ configValue ;
860849 }
861850 }
0 commit comments