1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

Set repository language from query parameter (#1257)

This commit is contained in:
Luffy
2025-04-15 09:38:31 +08:00
committed by GitHub
parent 77d8a8c8f0
commit 2d4419cfd5

View File

@@ -11,13 +11,16 @@ use phpweb\UserNotes\UserNote;
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'];
}
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';