File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010namespace OxidEsales \Twig \Extensions ;
1111
12- use OxidEsales \EshopCommunity \Core \Di \ContainerFacade ;
1312use OxidEsales \EshopCommunity \Internal \Framework \Html \HtmlSanitizerInterface ;
1413use OxidEsales \EshopCommunity \Internal \Transition \Adapter \TemplateLogic \ContentFactory ;
1514use OxidEsales \Twig \TokenParser \IncludeContentTokenParser ;
@@ -22,11 +21,8 @@ class IncludeContentExtension extends AbstractExtension
2221{
2322 public function __construct (
2423 private ContentFactory $ contentFactory ,
25- private ? HtmlSanitizerInterface $ sanitizer = null
24+ private readonly HtmlSanitizerInterface $ sanitizer
2625 ) {
27- if ($ this ->sanitizer === null && ContainerFacade::has (HtmlSanitizerInterface::class)) {
28- $ this ->sanitizer = ContainerFacade::get (HtmlSanitizerInterface::class);
29- }
3026 }
3127
3228 /**
@@ -57,10 +53,6 @@ public function content(string $name): string
5753 throw new LoaderError ("Template is not active. " );
5854 }
5955
60- if (!$ this ->sanitizer ) {
61- return $ content ->oxcontents__oxcontent ->value ;
62- }
63-
6456 return $ this ->sanitizer ->sanitize ($ content ->oxcontents__oxcontent ->value );
6557 }
6658}
You can’t perform that action at this time.
0 commit comments