From 6c6aab900b7ade92d62c1cc04f2bbe100b985316 Mon Sep 17 00:00:00 2001 From: spirit Date: Sun, 17 Nov 2019 17:05:24 +0800 Subject: [PATCH] Markdown Supported while Forbidden --- functions.php | 5 +++++ 1 file changed, 5 insertions(+) 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)) {