15m44z 续: 匿名工单 issue 正文不写提单人名字(防假匿名)

用户指出: GitHub issue 是公开的, 匿名工单 body 写「玩家:steve」等于假匿名。
修: ghSyncCreate 按 token 前缀判 — bot(ghs_)建的匿名单 → body 只放工单正文+附件,
   不写提单人名字(提单人只记 PHP 后台 web_tickets.requester, 仅管理员可见,
   入库 645/661 行 requester=:player 不随匿名改, 管理员始终能看到真实提单人);
   实名单(gho_/ghp_)→ 保留「玩家:xxx」(提单人是本人, 公开无妨)。
gh_api.php 部署 MATCH。
This commit is contained in:
ypsdf1
2026-11-26 10:08:16 +08:00
parent 1b7b5a2205
commit d60c45c1ab
+11 -1
View File
@@ -260,7 +260,17 @@ function ghSyncCreate($ticketId, $player, $title, $description, $images = [], $t
. ' desc_len=' . mb_strlen($desc) . ' desc_len=' . mb_strlen($desc)
. ' desc_head=' . mb_substr($desc, 0, 80) . ' desc_head=' . mb_substr($desc, 0, 80)
. ' imgs=' . json_encode($images, JSON_UNESCAPED_UNICODE)); . ' imgs=' . json_encode($images, JSON_UNESCAPED_UNICODE));
$bodyParts = ['玩家:`' . $player . '`', '']; // ★ 15m44z 第三部分:匿名工单 issue 正文【不写提单人名字】。
// GitHub issue 是公开的,body 写「玩家:steve」等于假匿名。判定:token 是
// appbot installation token(ghs_ 前缀)→ 匿名工单 → body 只放工单正文+附件,不提单人信息
// (提单人名字只记 PHP 后台 web_tickets.requester,仅管理员可见);实名工单(token gho_/ghp_)
// → 保留「玩家:xxx」(提单人是本人,公开无妨)。
$isAnonIssue = (strpos((string)$token, 'ghs_') === 0);
if ($isAnonIssue) {
$bodyParts = [];
} else {
$bodyParts = ['玩家:`' . $player . '`', ''];
}
if ($desc !== '') $bodyParts[] = $desc; if ($desc !== '') $bodyParts[] = $desc;
if (is_array($images) && count($images) > 0) { if (is_array($images) && count($images) > 0) {
$bodyParts[] = ''; $bodyParts[] = '';