File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
app/code/Meta/Catalog/Model/Product/Feed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -412,6 +412,14 @@ private function getDescription(Product $product)
412
412
413
413
// phpcs:ignore
414
414
$ description = html_entity_decode ($ description );
415
+
416
+ // remove style tag and its content from description
417
+ // phpcs:ignore
418
+ $ description = html_entity_decode (preg_replace (
419
+ '/<\s*style.+?<\s*\/\s*style.*?>/ ' ,
420
+ '' ,
421
+ $ description
422
+ ));
415
423
// phpcs:ignore
416
424
$ description = html_entity_decode (preg_replace ('/<[^<]+?>/ ' , '' , $ description ));
417
425
return $ this ->builderTools ->lowercaseIfAllCaps ($ description );
@@ -439,6 +447,17 @@ private function getRichDescription(Product $product)
439
447
return '' ;
440
448
}
441
449
450
+ // phpcs:ignore
451
+ $ description = html_entity_decode ($ description );
452
+
453
+ // remove style tag and its content from description
454
+ // phpcs:ignore
455
+ $ description = html_entity_decode (preg_replace (
456
+ '/<\s*style.+?<\s*\/\s*style.*?>/ ' ,
457
+ '' ,
458
+ $ description
459
+ ));
460
+
442
461
return $ this ->trimAttribute (
443
462
self ::ATTR_RICH_DESCRIPTION ,
444
463
strip_tags ($ description , self ::ALLOWED_TAGS_FOR_RICH_TEXT_DESCRIPTION )
You can’t perform that action at this time.
0 commit comments