File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
app/code/Magento/PageBuilder/Plugin/Filter Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -150,8 +150,6 @@ private function convertEncodedHtmlContentTypesToPlaceholders(
150
150
): void {
151
151
$ xpath = new \DOMXPath ($ document );
152
152
153
- $ uniqueNodeNameToDecodedOuterHtmlMap = [];
154
-
155
153
/** @var $htmlContentTypeNodes \DOMNode[] */
156
154
$ htmlContentTypeNodes = $ xpath ->query ('//*[@data-content-type="html" and not(@data-decoded="true")] ' );
157
155
@@ -170,6 +168,9 @@ private function convertEncodedHtmlContentTypesToPlaceholders(
170
168
$ preDecodedOuterHtml = $ document ->saveHTML ($ htmlContentTypeNode );
171
169
$ decodedOuterHtml = html_entity_decode ($ preDecodedOuterHtml );
172
170
171
+ // generate unique node name element to replace with decoded html contents at end of processing;
172
+ // goal is to create a document as few times as possible to prevent inadvertent parsing of contents as html
173
+ // by the dom library
173
174
$ uniqueNodeName = 'a ' . md5 (uniqid ('' , true ));
174
175
175
176
$ uniqueNode = new \DOMElement ($ uniqueNodeName );
You can’t perform that action at this time.
0 commit comments