--- fenglin/bbs/article_service_post.php 2025/10/24 02:45:16 1.10 +++ fenglin/bbs/article_service_post.php 2026/02/11 10:59:14 1.13 @@ -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( @@ -126,7 +128,7 @@ } // Calculate length of content - $length = str_length(LML($content, false, 1024)); + $length = str_length($content, true); // Initial variables $tid = 0; @@ -394,7 +396,7 @@ } // Get upload quota and used space - $atta_id_list = "-1"; + $atta_id_list = array(-1); $attachment_count = (isset($_FILES['attachment']['error']) ? count($_FILES['attachment']['error']) : 0); if ($attachment_count > $BBS_upload_count_limit) { @@ -568,7 +570,7 @@ } $attachment_id = mysqli_insert_id($db_conn); - $atta_id_list .= ("," . $attachment_id); + array_push($atta_id_list, $attachment_id); $file_path = "upload/" . $attachment_id; if(!move_uploaded_file($_FILES['attachment']['tmp_name'][$i], $file_path)) @@ -726,7 +728,9 @@ } // Link attachments to article - $sql = "UPDATE upload_file SET ref_AID = $aid WHERE AID IN ($atta_id_list)"; + $sql = "UPDATE upload_file SET ref_AID = $aid WHERE AID IN (" . + implode(",", $atta_id_list) . + ")"; $rs = mysqli_query($db_conn, $sql); if ($rs == false)