fix some security issues + change username min length to 3

This commit is contained in:
xiaomlove
2022-12-08 20:43:33 +08:00
parent a0fb2c61d0
commit a39067021c
14 changed files with 83 additions and 50 deletions

View File

@@ -12,18 +12,25 @@ if (!empty($_POST['setdealt'])) {
if (empty($_POST['delcheater'])) {
stderr("Error", $lang_functions['select_at_least_one_record']);
}
$res = sql_query ("SELECT id FROM cheaters WHERE dealtwith=0 AND id IN (" . implode(", ", $_POST['delcheater']) . ")");
while ($arr = mysql_fetch_assoc($res))
sql_query ("UPDATE cheaters SET dealtwith=1, dealtby = {$CURUSER['id']} WHERE id = {$arr['id']}") or sqlerr();
// $res = sql_query ("SELECT id FROM cheaters WHERE dealtwith=0 AND id IN (" . implode(", ", $_POST['delcheater']) . ")");
// while ($arr = mysql_fetch_assoc($res))
// sql_query ("UPDATE cheaters SET dealtwith=1, dealtby = {$CURUSER['id']} WHERE id = {$arr['id']}") or sqlerr();
\App\Models\Cheater::query()->whereIn('id', $_POST['delcheater'])
->where('dealtwith', 0)
->update(['dealtwith' => 1, 'dealtby' => $CURUSER['id']])
;
$Cache->delete_value('staff_new_cheater_count');
}
elseif (!empty($_POST['delete'])) {
if (empty($_POST['delcheater'])) {
stderr("Error", $lang_functions['select_at_least_one_record']);
}
$res = sql_query ("SELECT id FROM cheaters WHERE id IN (" . implode(", ", $_POST['delcheater']) . ")");
while ($arr = mysql_fetch_assoc($res))
sql_query ("DELETE from cheaters WHERE id = {$arr['id']}") or sqlerr();
// $res = sql_query ("SELECT id FROM cheaters WHERE id IN (" . implode(", ", $_POST['delcheater']) . ")");
// while ($arr = mysql_fetch_assoc($res))
// sql_query ("DELETE from cheaters WHERE id = {$arr['id']}") or sqlerr();
\App\Models\Cheater::query()->whereIn('id', $_POST['delcheater'])->delete();
$Cache->delete_value('staff_new_cheater_count');
}