diff --git a/includes/class-content.php b/includes/class-content.php index f431dd7..33dc633 100644 --- a/includes/class-content.php +++ b/includes/class-content.php @@ -30,6 +30,9 @@ public static function get_republishable_content( $content, $post_id = false, $e // Remove comments from the content. (Lookin' at you, Gutenberg.) $content = preg_replace( '//i', ' ', $content ); + // Remove scripts from the content. + $content = preg_replace( '@]*?>.*?@si', '', $content ); + /** * What tags do we want to keep in the embed? * Not things from our server. @@ -201,6 +204,7 @@ private static function convert_html_to_plain_text( $html_content ) { $html_content = preg_replace( '/]*>(.*?)<\/h[1-6]>/is', "\n$1\n\n", $html_content ); $html_content = preg_replace( '/]*>(.*?)<\/p>/is', "$1\n\n", $html_content ); $html_content = preg_replace( '//i', "\n", $html_content ); + $html_content = preg_replace( '/]*?>.*?<\/style>/si', '', $html_content ); // ul to bullet points $html_content = preg_replace_callback(