From d79a92990920bbcedd63858d24734056fb76a96e Mon Sep 17 00:00:00 2001 From: filesite Date: Wed, 8 May 2024 18:51:54 +0800 Subject: [PATCH] remove space character in tag --- plugins/Common.php | 3 +++ themes/tajian/controller/FrontapiController.php | 1 + 2 files changed, 4 insertions(+) diff --git a/plugins/Common.php b/plugins/Common.php index 77416c7..993546a 100644 --- a/plugins/Common.php +++ b/plugins/Common.php @@ -11,6 +11,9 @@ Class Common { '<', '>', '\/', + ' ', + ';', + ';', ); return str_replace($findChars, '', $str); diff --git a/themes/tajian/controller/FrontapiController.php b/themes/tajian/controller/FrontapiController.php index 243de46..fb9ab45 100644 --- a/themes/tajian/controller/FrontapiController.php +++ b/themes/tajian/controller/FrontapiController.php @@ -894,6 +894,7 @@ eof; if (empty($tag_to_add)) { $err = "参数错误,缺少tag传参"; }else { + $tag_to_add = Common::cleanSpecialChars($tag_to_add); $tagLen = mb_strlen($tag_to_add, 'utf-8'); if ($tagLen < 2 || $tagLen > 15) { $err = '分类名长度不符合规则,请填写 2 - 15 个汉字、数字、英文字符';