diff --git a/include/shared-manual.inc b/include/shared-manual.inc index 6b0fed09f3..d14d6c4565 100644 --- a/include/shared-manual.inc +++ b/include/shared-manual.inc @@ -30,7 +30,7 @@ use phpweb\UserNotes\UserNote; * * @param array $notes */ -function manual_notes($notes):void { +function manual_notes($notes, $repo = 'en'):void { // Get needed values list($filename) = $GLOBALS['PGI']['this']; @@ -45,6 +45,7 @@ function manual_notes($notes):void { // Link target to add a note to the current manual page, // and it's extended form with a [+] image $addnotelink = '/manual/add-note.php?sect=' . $filename . + '&repo=' . $repo . '&redirect=' . $_SERVER['BASE_HREF']; $addnotesnippet = make_link( $addnotelink, @@ -408,7 +409,7 @@ function manual_footer($setup): void { CONTRIBUTE; - manual_notes($USERNOTES); + manual_notes($USERNOTES, $repo); site_footer([ 'related_menu' => $__RELATED['toc'], 'related_menu_deprecated' => $__RELATED['toc_deprecated'], diff --git a/manual/add-note.php b/manual/add-note.php index a298fe4fb4..79c18b89d7 100644 --- a/manual/add-note.php +++ b/manual/add-note.php @@ -18,6 +18,10 @@ if (empty($_POST['redirect']) && isset($_GET['redirect'])) { $_POST['redirect'] = $_GET['redirect']; } +// 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; @@ -258,8 +262,8 @@