Skip to content

Commit b585014

Browse files
authored
Link to GH issues instead of bugs.php.net for documentation issues (#1078)
1 parent 0d192a2 commit b585014

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

include/shared-manual.inc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use phpweb\UserNotes\UserNote;
3030
*
3131
* @param array<string, UserNote> $notes
3232
*/
33-
function manual_notes($notes):void {
33+
function manual_notes($notes, $repo = 'en'):void {
3434
// Get needed values
3535
list($filename) = $GLOBALS['PGI']['this'];
3636

@@ -45,6 +45,7 @@ function manual_notes($notes):void {
4545
// Link target to add a note to the current manual page,
4646
// and it's extended form with a [+] image
4747
$addnotelink = '/manual/add-note.php?sect=' . $filename .
48+
'&amp;repo=' . $repo .
4849
'&amp;redirect=' . $_SERVER['BASE_HREF'];
4950
$addnotesnippet = make_link(
5051
$addnotelink,
@@ -408,7 +409,7 @@ function manual_footer($setup): void {
408409
</div>
409410
CONTRIBUTE;
410411

411-
manual_notes($USERNOTES);
412+
manual_notes($USERNOTES, $repo);
412413
site_footer([
413414
'related_menu' => $__RELATED['toc'],
414415
'related_menu_deprecated' => $__RELATED['toc_deprecated'],

manual/add-note.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
if (empty($_POST['redirect']) && isset($_GET['redirect'])) {
1919
$_POST['redirect'] = $_GET['redirect'];
2020
}
21+
// Assume English if we didn't get a language
22+
if (empty($_POST['repo'])) {
23+
$_POST['repo'] = 'en';
24+
}
2125

2226
// Decide on whether all vars are present for processing
2327
$process = true;
@@ -258,8 +262,8 @@
258262
<div class='columns'>
259263
<ul>
260264
<li><strong>Bug reports &amp; Missing documentation</strong>
261-
Instead <a href="http://bugs.php.net/report.php?bug_type=Documentation+problem<?php echo isset($_POST['sect']) ? '&amp;manpage=' . clean($_POST['sect']) : ''; ?>">report a bug</a>
262-
for this manual page to the bug database.
265+
Instead <a href="https://github.com/php/doc-<?=clean($_POST['repo'])?>/issues/new?body=From%20manual%20page:%20https:%2F%2Fphp.net%2F<?=clean($_POST['sect'])?>%0A%0A---">report an issue</a>
266+
for this manual page.
263267
</li>
264268
<li><strong>Support questions or request for help</strong> See the <a href="/support.php">support page</a> for available options. In other words, do not ask questions within the user notes.</li>
265269
<li><strong>References to other notes or authors</strong> This is not a forum; we do not encourage nor permit discussions here. Further, if a note is referenced directly and is later removed or modified it causes confusion.
@@ -347,9 +351,9 @@
347351
<td colspan="2">
348352
<b>
349353
<a href="/support.php">Click here to go to the support pages.</a><br>
350-
<a href="http://bugs.php.net/report.php?bug_type=Documentation+problem&amp;manpage=<?php echo clean($_POST['sect']); ?>">Click here to submit a bug report.</a><br>
351-
<a href="http://bugs.php.net/report.php?bug_type=Documentation+problem&amp;manpage=<?php echo clean($_POST['sect']); ?>">Click here to request a feature.</a><br>
352-
(Again, please note, if you ask a question, report a bug, or request a feature,
354+
<a href="https://github.com/php/doc-<?=clean($_POST['repo'])?>/issues/new?body=From%20manual%20page:%20https:%2F%2Fphp.net%2F<?=clean($_POST['sect'])?>%0A%0A---">Click here to submit an issue about the documentation.</a><br>
355+
<a href="https://github.com/php/php-src/issues/new?body=From%20manual%20page:%20https:%2F%2Fphp.net%2F<?=clean($_POST['sect'])?>%0A%0A---">Click here to submit an issue about PHP itself.</a><br>
356+
(Again, please note, if you ask a question, report an issue, or request a feature,
353357
your note <i>will be deleted</i>.)
354358
</b>
355359
</td>

styles/add-note.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
-webkit-columns:15rem;
4848
-moz-columns:15rem;
4949
columns:15rem;
50+
margin-bottom: 1em;
5051
}
5152
#whatnottoenter .columns li {
5253
-webkit-column-break-inside:avoid;

0 commit comments

Comments
 (0)