--- fenglin/bbs/msg_service_send.php 2025/04/29 11:55:32 1.3 +++ fenglin/bbs/msg_service_send.php 2025/11/06 12:39:59 1.5 @@ -5,10 +5,8 @@ require_once "./session_init.inc.php"; require_once "./check_sub.inc.php"; - $data = json_decode(file_get_contents("php://input"), true); - - $uid = (isset($data["uid"]) ? intval($data["uid"]) : 0); - $content = (isset($data["content"]) ? $data["content"] : ""); + $uid = (isset($_POST["uid"]) ? intval($_POST["uid"]) : 0); + $content = (isset($_POST["content"]) ? $_POST["content"] : ""); $result_set = array( "return" => array( @@ -39,8 +37,11 @@ exit(json_encode($result_set)); } - $r_content = check_badwords(split_line($content, "", 256, 10), "****"); - if ($content != $r_content) + $content = split_line($content, "", 256, 10); + + $bw_count = 0; + $r_content = check_badwords($content, "****", $bw_count); + if ($bw_count > 0) { $result_set["return"]["code"] = -1; $result_set["return"]["message"] = "内容不符合要求";