From 314d1ca923f88ad3f3f97262145013dbc4caca11 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Sat, 13 May 2023 01:59:51 +0800 Subject: [PATCH] fix signup 500 when close register --- include/constants.php | 2 +- include/functions.php | 12 ++++++------ public/signup.php | 5 ++++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/include/constants.php b/include/constants.php index c6e72adb..62fe6632 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@ = $maxloginattempts) { sql_query("UPDATE loginattempts SET banned = 'yes' WHERE ip=$ip") or sqlerr(__FILE__, __LINE__); - stderr($type.$lang_functions['std_locked'].$type.$lang_functions['std_attempts_reached'], $lang_functions['std_your_ip_banned']); + stderr($type.$lang_functions['std_locked'].$type.$lang_functions['std_attempts_reached'], $lang_functions['std_your_ip_banned'], true, true); } } function failedlogins ($type = 'login', $recover = false, $head = true) @@ -1678,13 +1678,13 @@ function registration_check($type = "invitesystem", $maxuserscheck = true, $ipch global $invitesystem, $registration, $maxusers, $SITENAME, $maxip; if ($type == "invitesystem") { if ($invitesystem == "no") { - stderr($lang_functions['std_oops'], $lang_functions['std_invite_system_disabled'], 0, false); + stderr($lang_functions['std_oops'], $lang_functions['std_invite_system_disabled'], 0, true); } } if ($type == "normal") { if ($registration == "no") { - stderr($lang_functions['std_sorry'], $lang_functions['std_open_registration_disabled'], 0, false); + stderr($lang_functions['std_sorry'], $lang_functions['std_open_registration_disabled'], 0, true); } } @@ -1692,14 +1692,14 @@ function registration_check($type = "invitesystem", $maxuserscheck = true, $ipch $res = sql_query("SELECT COUNT(*) FROM users") or sqlerr(__FILE__, __LINE__); $arr = mysql_fetch_row($res); if ($arr[0] >= $maxusers) - stderr($lang_functions['std_sorry'], $lang_functions['std_account_limit_reached'], 0, false); + stderr($lang_functions['std_sorry'], $lang_functions['std_account_limit_reached'], 0, true); } if ($ipcheck) { $ip = getip () ; $a = (@mysql_fetch_row(@sql_query("select count(*) from users where ip='" . mysql_real_escape_string($ip) . "'"))) or sqlerr(__FILE__, __LINE__); if ($a[0] > $maxip) - stderr($lang_functions['std_sorry'], $lang_functions['std_the_ip']."" . htmlspecialchars($ip) ."". $lang_functions['std_used_many_times'],false, false); + stderr($lang_functions['std_sorry'], $lang_functions['std_the_ip']."" . htmlspecialchars($ip) ."". $lang_functions['std_used_many_times'],false, true); } return true; } @@ -2912,7 +2912,7 @@ function stdfoot() { global $hook; print(""); print("
"); - if ($Advertisement->enable_ad()){ + if ($Advertisement && $Advertisement->enable_ad()){ $footerad=$Advertisement->get_ad('footer'); if ($footerad) echo "
".$footerad[0]."
"; diff --git a/public/signup.php b/public/signup.php index 736bfadf..6b5bc0d9 100644 --- a/public/signup.php +++ b/public/signup.php @@ -23,7 +23,10 @@ if ($type == 'invite') { registration_check(); failedloginscheck ("Invite signup"); - $code = $_GET["invitenumber"]; + $code = $_GET["invitenumber"] ?? ''; + if (empty($code)) { + stderr($lang_signup['std_error'], "Require invitenumber"); + } $nuIP = getip(); $dom = @gethostbyaddr($nuIP);