From 77616a1efaf719a88a54c8d4033db4520809f38a Mon Sep 17 00:00:00 2001 From: Luffy <52o@qq52o.cn> Date: Mon, 14 Apr 2025 10:45:49 +0800 Subject: [PATCH 1/2] Set repository language from query parameter --- manual/add-note.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manual/add-note.php b/manual/add-note.php index 79c18b89d7..86753f4e5b 100644 --- a/manual/add-note.php +++ b/manual/add-note.php @@ -19,8 +19,8 @@ $_POST['redirect'] = $_GET['redirect']; } // Assume English if we didn't get a language -if (empty($_POST['repo'])) { - $_POST['repo'] = 'en'; +if (empty($_POST['repo']) && isset($_GET['repo'])) { + $_POST['repo'] = $_GET['repo']; } // Decide on whether all vars are present for processing From 035340719f1f80878bb91099f707b7f96b9553e2 Mon Sep 17 00:00:00 2001 From: Luffy <52o@qq52o.cn> Date: Mon, 14 Apr 2025 10:48:00 +0800 Subject: [PATCH 2/2] Copy "repo" from GET to POST and set default language to English --- manual/add-note.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/manual/add-note.php b/manual/add-note.php index 86753f4e5b..4cb6651366 100644 --- a/manual/add-note.php +++ b/manual/add-note.php @@ -11,17 +11,20 @@ site_header("Add Manual Note", ['css' => 'add-note.css']); -// Copy over "sect" and "redirect" from GET to POST +// Copy over "sect", "redirect" and "repo" from GET to POST if (empty($_POST['sect']) && isset($_GET['sect'])) { $_POST['sect'] = $_GET['sect']; } if (empty($_POST['redirect']) && isset($_GET['redirect'])) { $_POST['redirect'] = $_GET['redirect']; } -// Assume English if we didn't get a language if (empty($_POST['repo']) && isset($_GET['repo'])) { $_POST['repo'] = $_GET['repo']; } +// Assume English if we didn't get a language +if (empty($_POST['repo'])) { + $_POST['repo'] = 'en'; +} // Decide on whether all vars are present for processing $process = true;