Skip to content

Commit

Permalink
Fix greediness of regex style clean in TextExtractor.php (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
frithjof authored Dec 14, 2023
1 parent 524ae6e commit b15f003
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Resource/FieldTransformer/Html/TextExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ protected function cleanHtml(string $html): string|array|null
{
$text = preg_replace([
'@(<script[^>]*?>.*?</script>)@si', // Strip out javascript
'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly
'@<style[^>]*?>.*?</style>@si', // Strip style tags properly
'@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments including CDATA
], '', $html);

Expand Down

0 comments on commit b15f003

Please sign in to comment.