| @@ -7,9 +7,8 @@ | ||
| 7 | 7 | |
| 8 | 8 | namespace Activitypub\Collection; |
| 9 | 9 | |
| 10 | 10 | use Activitypub\Link; |
| 11 | -use Activitypub\Sanitize; | |
| 12 | 11 | |
| 13 | 12 | use function Activitypub\site_supports_blocks; |
| 14 | 13 | |
| 15 | 14 | /** |
| @@ -81,11 +80,12 @@ | ||
| 81 | 80 | } |
| 82 | 81 | $content = \wptexturize( $content ); |
| 83 | 82 | $content = \wp_filter_content_tags( $content ); |
| 84 | 83 | |
| 84 | + // Replace script and style elements. | |
| 85 | + $content = \preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $content ); | |
| 85 | 86 | $content = \strip_shortcodes( $content ); |
| 86 | - $content = Sanitize::clean_html( $content ); | |
| 87 | - $content = Sanitize::strip_whitespace( $content ); | |
| 87 | + $content = \trim( \preg_replace( '/[\n\r\t]/', '', $content ) ); | |
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | 90 | * Filters the content of an extra field. |
| 91 | 91 | * |