更新
This commit is contained in:
parent
140760d820
commit
5f2fc632bb
@ -5,23 +5,29 @@ class Intercept
|
||||
{
|
||||
public static function message($comment)
|
||||
{
|
||||
/* 如果用户输入内容画图模式 */
|
||||
/* 用户输入内容画图模式 */
|
||||
if (preg_match('/\{!\{(.*)\}!\}/', $comment['text'], $matches)) {
|
||||
/* 如果判断是否有双引号,如果有双引号,则禁止评论 */
|
||||
if (strpos($matches[1], '"') !== false || _checkXSS($matches[1])) {
|
||||
$comment['status'] = 'waiting';
|
||||
}
|
||||
/* 普通评论 */
|
||||
} else {
|
||||
/* 判断评论内容是否包含敏感词 */
|
||||
if (Helper::options()->JSensitiveWords) {
|
||||
if (_checkSensitiveWords(Helper::options()->JSensitiveWords, $comment['text'])) {
|
||||
$comment['status'] = 'waiting';
|
||||
/* 判断用户输入是否大于字符 */
|
||||
if (Helper::options()->JTextLimit && strlen($comment['text']) > Helper::options()->JTextLimit) {
|
||||
$comment['status'] = 'waiting';
|
||||
} else {
|
||||
/* 判断评论内容是否包含敏感词 */
|
||||
if (Helper::options()->JSensitiveWords) {
|
||||
if (_checkSensitiveWords(Helper::options()->JSensitiveWords, $comment['text'])) {
|
||||
$comment['status'] = 'waiting';
|
||||
}
|
||||
}
|
||||
}
|
||||
/* 判断评论是否至少包含一个中文 */
|
||||
if (Helper::options()->JLimitOneChinese === "on") {
|
||||
if (preg_match("/[\x{4e00}-\x{9fa5}]/u", $comment['text']) == 0) {
|
||||
$comment['status'] = 'waiting';
|
||||
/* 判断评论是否至少包含一个中文 */
|
||||
if (Helper::options()->JLimitOneChinese === "on") {
|
||||
if (preg_match("/[\x{4e00}-\x{9fa5}]/u", $comment['text']) == 0) {
|
||||
$comment['status'] = 'waiting';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
/* 获取主题当前版本号 */
|
||||
function _getVersion()
|
||||
{
|
||||
return "6.4.7";
|
||||
return "6.4.8";
|
||||
};
|
||||
|
||||
/* 判断是否是手机 */
|
||||
|
@ -864,6 +864,17 @@ function themeConfig($form)
|
||||
$JLimitOneChinese->setAttribute('class', 'joe_content joe_other');
|
||||
$form->addInput($JLimitOneChinese->multiMode());
|
||||
|
||||
$JTextLimit = new Typecho_Widget_Helper_Form_Element_Text(
|
||||
'JTextLimit',
|
||||
NULL,
|
||||
NULL,
|
||||
'限制用户评论最大字符',
|
||||
'介绍:如果用户评论的内容超出字符限制,则将会把评论置为审核状态 <br />
|
||||
其他:请输入数字格式,不填写则不限制'
|
||||
);
|
||||
$JTextLimit->setAttribute('class', 'joe_content joe_other');
|
||||
$form->addInput($JTextLimit->multiMode());
|
||||
|
||||
$JSiteMap = new Typecho_Widget_Helper_Form_Element_Select(
|
||||
'JSiteMap',
|
||||
array(
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "typecho-joe-next",
|
||||
"version": "6.4.7",
|
||||
"version": "6.4.8",
|
||||
"description": "A Theme Of Typecho",
|
||||
"main": "index.php",
|
||||
"keywords": [
|
||||
|
Loading…
Reference in New Issue
Block a user