From f2357a0bb50ad94678e1724f0af5cbf267781466 Mon Sep 17 00:00:00 2001 From: chinazyq <21013965@mail.ecust.edu.cn> Date: Mon, 29 Apr 2024 15:32:11 +0800 Subject: [PATCH 1/2] fix: invite preRegisterUsername limit --- lang/chs/lang_takeinvite.php | 1 + lang/cht/lang_takeinvite.php | 1 + lang/en/lang_takeinvite.php | 1 + public/takeinvite.php | 2 ++ 4 files changed, 5 insertions(+) diff --git a/lang/chs/lang_takeinvite.php b/lang/chs/lang_takeinvite.php index 605dddc9..c317024b 100644 --- a/lang/chs/lang_takeinvite.php +++ b/lang/chs/lang_takeinvite.php @@ -3,6 +3,7 @@ $lang_takeinvite = array ( 'head_invitation_failed' => "邀请失败!", + 'std_username_too_long' => "对不起,用户名过长(至多12个字符)", 'std_must_enter_email' => "你必须输入邮箱地址!", 'std_invalid_email_address' => "无效的邮箱地址!", 'std_must_enter_personal_message' => "请添加信件中的私人内容。", diff --git a/lang/cht/lang_takeinvite.php b/lang/cht/lang_takeinvite.php index e4c2e8f3..b5e13c59 100644 --- a/lang/cht/lang_takeinvite.php +++ b/lang/cht/lang_takeinvite.php @@ -3,6 +3,7 @@ $lang_takeinvite = array ( 'head_invitation_failed' => "邀請失敗!", + 'std_username_too_long' => "對不起,用戶名過長(至多12個字元)", 'std_must_enter_email' => "你必須輸入郵箱位址!", 'std_invalid_email_address' => "無效的郵箱地址!", 'std_must_enter_personal_message' => "請添加信件中的私人內容。", diff --git a/lang/en/lang_takeinvite.php b/lang/en/lang_takeinvite.php index ddbbf75c..03b6a0cc 100644 --- a/lang/en/lang_takeinvite.php +++ b/lang/en/lang_takeinvite.php @@ -3,6 +3,7 @@ $lang_takeinvite = array ( 'head_invitation_failed' => "Invitation failed!", + 'std_username_too_long' => "Sorry, the username is too long (up to 12 characters)", 'std_must_enter_email' => "You must enter an email address!", 'std_invalid_email_address' => "Invalid email address!", 'std_must_enter_personal_message' => "Please add a personal message.", diff --git a/public/takeinvite.php b/public/takeinvite.php index f65a1e41..8642839a 100644 --- a/public/takeinvite.php +++ b/public/takeinvite.php @@ -21,6 +21,8 @@ $email = unesc(htmlspecialchars(trim($_POST["email"]))); $email = safe_email($email); $preRegisterUsername = $_POST['pre_register_username'] ?? ''; $isPreRegisterEmailAndUsername = get_setting("system.is_invite_pre_email_and_username") == "yes"; +if (strlen($preRegisterUsername) > 12) + bark($lang_takeinvite['std_username_too_long']); if (!$email) bark($lang_takeinvite['std_must_enter_email']); if (!check_email($email)) From e58e91e7fae6ca0f837b4245d5e90f25fd5509e8 Mon Sep 17 00:00:00 2001 From: xqw8889 Date: Wed, 1 May 2024 00:16:45 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=AE=BA=E5=9D=9B=E9=9A=90=E7=A7=81=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=AE=9E=E6=97=B6=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Repositories/SettingRepository.php | 1 + include/globalfunctions.php | 1 + 2 files changed, 2 insertions(+) diff --git a/app/Repositories/SettingRepository.php b/app/Repositories/SettingRepository.php index c483fbc1..fe92bc93 100644 --- a/app/Repositories/SettingRepository.php +++ b/app/Repositories/SettingRepository.php @@ -52,6 +52,7 @@ class SettingRepository extends BaseRepository do_log("sql: $sql, result: $result"); NexusDB::cache_del("nexus_settings_in_laravel"); NexusDB::cache_del("nexus_settings_in_nexus"); + NexusDB::cache_del('setting_protected_forum'); return $result; } diff --git a/include/globalfunctions.php b/include/globalfunctions.php index c821af7c..e976e365 100644 --- a/include/globalfunctions.php +++ b/include/globalfunctions.php @@ -1025,6 +1025,7 @@ function clear_setting_cache() do_log("clear_setting_cache"); \Nexus\Database\NexusDB::cache_del('nexus_settings_in_laravel'); \Nexus\Database\NexusDB::cache_del('nexus_settings_in_nexus'); + \Nexus\Database\NexusDB::cache_del('setting_protected_forum'); $channel = nexus_env("CHANNEL_NAME_SETTING"); if (!empty($channel)) { \Nexus\Database\NexusDB::redis()->publish($channel, "update");