diff --git a/functions.php b/functions.php index 4de01d5..76c5290 100644 --- a/functions.php +++ b/functions.php @@ -1659,6 +1659,11 @@ if (akina_option('sakura_widget')) { // 评论Markdown解析 function markdown_parser($incoming_comment) { global $wpdb,$comment_markdown_content; + $re = '/```([\s\S]*?)```[\s]*|`{1,2}[^`](.*?)`{1,2}|\[.*?\]\([\s\S]*?\)/m'; + if(preg_replace($re,'temp',$incoming_comment['comment_content']) != strip_tags(preg_replace($re,'temp',$incoming_comment['comment_content']))){ + siren_ajax_comment_err('评论只支持Markdown啦,见谅╮( ̄▽ ̄)╭
Markdown Supported while Forbidden'); + return( $incoming_comment ); + } $myCustomer = $wpdb->get_row("SELECT * FROM wp_comments"); //Add column if not present. if (!isset($myCustomer->say_state)) {