修复种子页面评论引用用户不存在时报错问题

This commit is contained in:
tonghoil
2025-09-21 15:10:36 +08:00
parent 5e2a341a79
commit dfcd2d9391
3 changed files with 4 additions and 2 deletions

View File

@@ -117,10 +117,10 @@ if ($action == "add")
$commentid = intval($_GET["cid"] ?? 0);
int_check($commentid,true);
$res2 = sql_query("SELECT comments.text, users.username FROM comments JOIN users ON comments.user = users.id WHERE comments.id=$commentid") or sqlerr(__FILE__, __LINE__);
$res2 = sql_query("SELECT comments.text, users.username FROM comments LEFT JOIN users ON comments.user = users.id WHERE comments.id=$commentid") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($res2) != 1)
stderr($lang_forums['std_error'], $lang_forums['std_no_comment_id']);
stderr($lang_comment['std_error'], $lang_comment['std_no_comment_id']);
$arr2 = mysql_fetch_assoc($res2);
}

View File

@@ -7,6 +7,7 @@ return [
'user_not_exists' => '(orphaned)',
'time_units' => [
'week' => 'weeks',
'hour' => 'hours',
],
'select_all' => 'Select all',
'unselect_all' => 'Unselect all',

View File

@@ -7,6 +7,7 @@ return [
'user_not_exists' => '(無此帳戶)',
'time_units' => [
'week' => '周',
'hour' => '小時',
],
'select_all' => '全選',
'unselect_all' => '全不選',