--- fenglin/bbs/article_service_post.php 2025/04/27 04:18:22 1.5 +++ fenglin/bbs/article_service_post.php 2025/11/06 12:39:59 1.12 @@ -52,8 +52,9 @@ )); } - $r_title = check_badwords($title, "****"); - if ($title != $r_title) + $bw_count = 0; + $r_title = check_badwords($title, "****", $bw_count); + if ($bw_count > 0) { $result_set["return"]["code"] = -1; array_push($result_set["return"]["errorFields"], array( @@ -63,8 +64,9 @@ )); } - $r_content = check_badwords($content, "****"); - if ($content != $r_content) + $bw_count = 0; + $r_content = check_badwords($content, "****", $bw_count); + if ($bw_count > 0) { $result_set["return"]["code"] = -1; array_push($result_set["return"]["errorFields"], array( @@ -122,11 +124,11 @@ // Append indication of article update if ($id != 0) { - $content .= ("\n--\n※作者已于 " . date("Y-m-d H:i:s") . " 修改本文※\n"); + $content .= ("\n--\n※ 作者已于 " . (new DateTimeImmutable("", $_SESSION["BBS_user_tz"]))->format("Y-m-d H:i:s (\U\T\C P)") . " 修改本文※\n"); } // Calculate length of content - $length = str_length(LML($content, false, false, 1024)); + $length = str_length($content, true); // Initial variables $tid = 0; @@ -637,8 +639,8 @@ exit(json_encode($result_set)); } - //Notify the authors of the topic which is replyed. - $sql = "SELECT DISTINCT UID FROM bbs WHERE (AID = $tid OR TID = $tid) + //Notify the authors of the topic / article which is replyed. + $sql = "SELECT DISTINCT UID FROM bbs WHERE (AID = $tid OR AID = $reply_id) AND visible AND reply_note AND UID <> " . $_SESSION["BBS_uid"]; $rs = mysqli_query($db_conn, $sql); @@ -654,7 +656,7 @@ while ($row = mysqli_fetch_array($rs)) { //Send notification message - $msg_content = "[hide]SYS_Reply_Article[/hide]有人回复了您所发表/回复的主题文章,快来". + $msg_content = "有人回复了您所发表/回复的文章,快来". "[article $aid]看看[/article]《" . $r_title . "》吧!\n"; $sql = "INSERT INTO bbs_msg(fromUID, toUID, content, send_dt, send_ip) @@ -767,4 +769,3 @@ mysqli_close($db_conn); exit(json_encode($result_set)); -?>