Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions docs/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The `templates/pages/how_to_report.php`:
<?php $this->end('main_content') ?>

<?php $this->start('scripts') ?>
<script src="/js/feature.js"></script>
<script src="js/feature.js"></script>
<?php $this->end('scripts') ?>
```

Expand All @@ -51,15 +51,17 @@ The `templates/layout.php`:
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="/css/style.css">
<title>PHP Bug Tracking System :: <?= $title ?? '' ?></title>
<title>PHP :: <?= $this->e($title) ?></title>
<base href="<?= $siteScheme ?>://<?= $siteUrl.$GLOBALS['basedir'] ?>">
<link rel="shortcut icon" href="<?= $siteScheme ?>://<?= $siteUrl.$GLOBALS['basedir'] ?>images/favicon.ico">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<?= $this->block('main_content') ?>

<div><?= $siteUrl ?></div>

<script src="/js/app.js"></script>
<script src="js/app.js"></script>
<?= $this->block('scripts') ?>
</body>
</html>
Expand Down Expand Up @@ -121,7 +123,7 @@ The `templates/pages/index.php`:
<?php $this->extends('layout.php'); ?>

<?php $this->start('scripts'); ?>
<script src="/js/foo.js"></script>
<script src="js/foo.js"></script>
<?php $this->end('scripts'); ?>

<?php $this->start('content') ?>
Expand All @@ -138,7 +140,7 @@ The `templates/forms/form.php`:
</form>

<?php $this->append('scripts'); ?>
<script src="/js/bar.js"></script>
<script src="js/bar.js"></script>
<?php $this->end('scripts'); ?>
```

Expand All @@ -153,8 +155,8 @@ The final rendered page:
<input type="submit" value="Submit">
</form>

<script src="/js/foo.js"></script>
<script src="/js/bar.js"></script>
<script src="js/foo.js"></script>
<script src="js/bar.js"></script>
</body>
</html>
```
Expand Down
4 changes: 2 additions & 2 deletions include/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1542,11 +1542,11 @@ function response_header($title, $extraHeaders = '')
<a href="search.php">advanced search</a>&nbsp;|&nbsp;
<a href="search-howto.php">search howto</a>&nbsp;|&nbsp;
<a href="stats.php">statistics</a>&nbsp;|&nbsp;
<a href="random">random bug</a>&nbsp;|&nbsp;
<a href="index.php?random">random bug</a>&nbsp;|&nbsp;
<?php if ($is_logged) { ?>
<a href="search.php?cmd=display&amp;assign=<?php echo $username;?>">my bugs</a>&nbsp;|&nbsp;
<?php if ($logged_in === 'developer') { ?>
<a href="/admin/">admin</a>&nbsp;|&nbsp;
<a href="admin/">admin</a>&nbsp;|&nbsp;
<?php } ?>
<a href="logout.php">logout</a>
<?php } else { ?>
Expand Down
5 changes: 5 additions & 0 deletions include/prepend.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
define('DEVBOX', false);
}

// make sure $site_data['basedir'] ends with /
if (substr($site_data['basedir'], -1) !== '/') {
$site_data['basedir'] .= '/';
}

if (!isset($site_data['security_email'])) {
$site_data['security_email'] = '[email protected]';
}
Expand Down
31 changes: 16 additions & 15 deletions templates/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,46 @@
<head>
<meta charset="utf-8">
<title>PHP :: <?= $this->e($title) ?></title>
<link rel="shortcut icon" href="<?= $siteScheme ?>://<?= $siteUrl ?>/images/favicon.ico">
<link rel="stylesheet" href="/css/style.css">
<base href="<?= $siteScheme ?>://<?= $siteUrl.$GLOBALS['basedir'] ?>">
<link rel="shortcut icon" href="<?= $siteScheme ?>://<?= $siteUrl.$GLOBALS['basedir'] ?>images/favicon.ico">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<table id="top" class="head" cellspacing="0" cellpadding="0">
<tr>
<td class="head-logo">
<a href="/"><img src="/images/logo.png" alt="Bugs" vspace="2" hspace="2"></a>
<a href=""><img src="images/logo.png" alt="Bugs" vspace="2" hspace="2"></a>
</td>

<td class="head-menu">
<a href="https://php.net/">php.net</a>&nbsp;|&nbsp;
<a href="https://php.net/support.php">support</a>&nbsp;|&nbsp;
<a href="https://php.net/docs.php">documentation</a>&nbsp;|&nbsp;
<a href="/report.php">report a bug</a>&nbsp;|&nbsp;
<a href="/search.php">advanced search</a>&nbsp;|&nbsp;
<a href="/search-howto.php">search howto</a>&nbsp;|&nbsp;
<a href="/stats.php">statistics</a>&nbsp;|&nbsp;
<a href="/random">random bug</a>&nbsp;|&nbsp;
<a href="report.php">report a bug</a>&nbsp;|&nbsp;
<a href="search.php">advanced search</a>&nbsp;|&nbsp;
<a href="search-howto.php">search howto</a>&nbsp;|&nbsp;
<a href="stats.php">statistics</a>&nbsp;|&nbsp;
<a href="index.php?random">random bug</a>&nbsp;|&nbsp;
<?php if ($authIsLoggedIn): ?>
<a href="/search.php?cmd=display&assign=<?= $this->e($authUsername) ?>">my bugs</a>&nbsp;|&nbsp;
<a href="search.php?cmd=display&assign=<?= $this->e($authUsername) ?>">my bugs</a>&nbsp;|&nbsp;
<?php if ('developer' === $authRole): ?>
<a href="/admin/">admin</a>&nbsp;|&nbsp;
<a href="admin/">admin</a>&nbsp;|&nbsp;
<?php endif ?>
<a href="/logout.php">logout</a>
<a href="logout.php">logout</a>
<?php else: ?>
<a href="/login.php">login</a>
<a href="login.php">login</a>
<?php endif ?>
</td>
</tr>

<tr>
<td class="head-search" colspan="2">
<form method="get" action="/search.php">
<form method="get" action="search.php">
<p class="head-search">
<input type="hidden" name="cmd" value="display">
<small>go to bug id or search bugs for</small>
<input class="small" type="text" name="search_for" value="<?= $this->e($_GET['search_for'] ?? '') ?>" size="30">
<input type="image" src="/images/small_submit_white.gif" alt="search" style="vertical-align: middle;">
<input type="image" src="images/small_submit_white.gif" alt="search" style="vertical-align: middle;">
</p>
</form>
</td>
Expand All @@ -64,7 +65,7 @@
<tr>
<td class="foot-copy">
<small>
<a href="https://php.net/"><img src="/images/logo-small.gif" align="left" valign="middle" hspace="3" alt="PHP"></a>
<a href="https://php.net/"><img src="images/logo-small.gif" align="left" valign="middle" hspace="3" alt="PHP"></a>
<a href="https://php.net/copyright.php">Copyright &copy; 2001-<?= date('Y') ?> The PHP Group</a><br>
All rights reserved.
</small>
Expand Down
8 changes: 4 additions & 4 deletions templates/pages/admin/menu.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<p>
<a href="/admin/?action=phpinfo" <?= ('phpinfo' === $action) ? 'class="active"' : ''; ?>>
<a href="admin/?action=phpinfo" <?= ('phpinfo' === $action) ? 'class="active"' : ''; ?>>
phpinfo()
</a>
|
<a href="/admin/?action=list_lists" <?= ('list_lists' === $action) ? 'class="active"' : ''; ?>>
<a href="admin/?action=list_lists" <?= ('list_lists' === $action) ? 'class="active"' : ''; ?>>
Package mailing lists
</a>
|
<a href="/admin/?action=list_responses" <?= ('list_responses' === $action) ? 'class="active"' : ''; ?>>
<a href="admin/?action=list_responses" <?= ('list_responses' === $action) ? 'class="active"' : ''; ?>>
Quick fix responses
</a>
|
<a href="/admin/?action=mysql" <?= ('mysql' === $action) ? 'class="active"' : ''; ?>>
<a href="admin/?action=mysql" <?= ('mysql' === $action) ? 'class="active"' : ''; ?>>
Database status
</a>
</p>
2 changes: 1 addition & 1 deletion templates/pages/bugs_generating_backtrace.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<?php $this->start('content') ?>

<p>
<strong>Unix</strong> | <a href="/bugs-generating-backtrace-win32.php">Windows</a>
<strong>Unix</strong> | <a href="bugs-generating-backtrace-win32.php">Windows</a>
</p>

<h1>Generating a gdb backtrace</h1>
Expand Down
4 changes: 2 additions & 2 deletions templates/pages/bugs_generating_backtrace_win32.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<?php $this->start('content') ?>

<p>
<a href="/bugs-generating-backtrace.php">Unix</a> | <strong>Windows</strong>
<a href="bugs-generating-backtrace.php">Unix</a> | <strong>Windows</strong>
</p>

<h1>Generating a backtrace, <u>with</u> a compiler, on Windows</h1>
Expand Down Expand Up @@ -70,6 +70,6 @@
<p>After the analysis has finished, the DebugDiag Analysis Report opens in Internet
Explorer; the relevant part of that report is the stack backtrace, which looks similar
to the following:</p>
<p><img src="/images/backtrace-images-win32/backtrace.jpg" alt="Debug report backtrace screenshot"></a></p>
<p><img src="images/backtrace-images-win32/backtrace.jpg" alt="Debug report backtrace screenshot"></a></p>

<?php $this->end('content') ?>
8 changes: 4 additions & 4 deletions templates/pages/how_to_report.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<h2>Always search the bug database first.</h2>

<p>Advice is so good, we'll repeat it twice. Always <a
href="/search.php">search</a> the bug database first. As we said above, there's
href="search.php">search</a> the bug database first. As we said above, there's
a lot of users of PHP. The odds are good that if you've found a problem,
someone else has found it, too. If you spend a few minutes of your time making
sure that you're not filing a duplicate bug, that's a few more minutes someone
Expand Down Expand Up @@ -77,12 +77,12 @@
</li>
<li>
If PHP is crashing, include a backtrace. Instructions for doing this
can be found <a href="/bugs-generating-backtrace.php">here for *NIX users</a> and
<a href="/bugs-generating-backtrace-win32.php">here for Windows users</a>.
can be found <a href="bugs-generating-backtrace.php">here for *NIX users</a> and
<a href="bugs-generating-backtrace-win32.php">here for Windows users</a>.
</li>
<li>
<a href="http://valgrind.org">Valgrind</a> log can be also very useful.
See <a href="/bugs-getting-valgrind-log.php">instructions how to generate it</a>.
See <a href="bugs-getting-valgrind-log.php">instructions how to generate it</a>.
</li>
</ul>

Expand Down
20 changes: 10 additions & 10 deletions templates/pages/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<ul>
<li>
Used the form above or our <a href="/search.php">advanced search page</a>
Used the form above or our <a href="search.php">advanced search page</a>
to make sure nobody has reported the bug already.
</li>

Expand All @@ -19,7 +19,7 @@
</li>

<li>
Read our tips on <a href="/how-to-report.php">how to report a bug that
Read our tips on <a href="how-to-report.php">how to report a bug that
someone will want to help fix</a>.
</li>

Expand All @@ -30,8 +30,8 @@

<li>
See how to get a backtrace in case of a crash:
<a href="/bugs-generating-backtrace.php">for *NIX</a> and
<a href="/bugs-generating-backtrace-win32.php">for Windows</a>.
<a href="bugs-generating-backtrace.php">for *NIX</a> and
<a href="bugs-generating-backtrace-win32.php">for Windows</a>.
</li>

<li>
Expand All @@ -42,19 +42,19 @@

<p>Once you've double-checked that the bug you've found hasn't already been
reported, and that you have collected all the information you need to file an
excellent bug report, you can do so on our <a href="/report.php">bug reporting
excellent bug report, you can do so on our <a href="report.php">bug reporting
page</a>.</p>

<h1>Search the Bug System</h1>

<p>You can search all of the bugs that have been reported on our
<a href="/search.php">advanced search page</a>, or use the form at the top of the
page for a basic default search. Read the <a href="/search-howto.php">search howto</a>
<a href="search.php">advanced search page</a>, or use the form at the top of the
page for a basic default search. Read the <a href="search-howto.php">search howto</a>
for instructions on how search works.</p>

<p>If you have 10 minutes to kill and you want to help us out, grab a random
open bug and see if you can help resolve it. We have made it easy. Hit
<a href="/random">random</a> to go directly to a random open bug.</p>
<a href="index.php?random">random</a> to go directly to a random open bug.</p>

<p>Common searches</p>

Expand All @@ -67,10 +67,10 @@
<h1>Bug System Statistics</h1>

<p>You can view a variety of statistics about the bugs that have been reported
on our <a href="/stats.php">bug statistics page</a>.</p>
on our <a href="stats.php">bug statistics page</a>.</p>

<?php $this->end('content') ?>

<?php $this->start('scripts') ?>
<script src="/js/redirect.js"></script>
<script src="js/redirect.js"></script>
<?php $this->end('scripts') ?>
8 changes: 4 additions & 4 deletions templates/pages/search_how_to.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<h3>Basic Search</h3>

<p>
Within every <a href="/"><?= $siteUrl ?></a> webpage header is a search box,
Within every <a href=""><?= $siteUrl ?></a> webpage header is a search box,
this is the <i>basic</i> search option. You may enter in a numeric bug ID to
redirect to that bugs page or enter in a search term to perform a default bug
search. Load the advanced search to view the default values.
Expand All @@ -23,7 +23,7 @@
<h3>Advanced Search</h3>

<p>
Some explanations for most of the PHP bugs <a href="/search.php">advanced search</a>
Some explanations for most of the PHP bugs <a href="search.php">advanced search</a>
options.
</p>

Expand Down Expand Up @@ -75,7 +75,7 @@
requests feedback will be marked as <i>No Feedback</i> if no feedback transpires
after 15 days.
</li>
<li><strong>Old feedback</strong>: Bugs that have been requesting feedback for over60 days.</li>
<li><strong>Old feedback</strong>: Bugs that have been requesting feedback for over 60 days.</li>
<li>
<strong>Fresh</strong> : Bugs commented on in the last 30 days that are not closed,
duplicates, or not-a-bug. Only developers and the original author can affect this
Expand Down Expand Up @@ -165,7 +165,7 @@

<p>
You can view a variety of statistics about the bugs that have been reported on
our <a href="/stats.php">bug statistics page</a>.
our <a href="stats.php">bug statistics page</a>.
</p>

<?php $this->end('content') ?>
4 changes: 2 additions & 2 deletions www/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
redirect('bug.php?id='.$id);
}

if ('/random' === $_SERVER['REQUEST_URI']) {
if ($basedir.'index.php?random' === $_SERVER['REQUEST_URI']) {
$id = $container->get(BugRepository::class)->findRandom();
redirect('bug.php?id='.$id[0]);
}
Expand All @@ -41,7 +41,7 @@
// Prefix query strings with base URL
$searches = preg_filter(
'/^/',
'/search.php?limit=30&order_by=id&direction=DESC&cmd=display&status=Open',
'search.php?limit=30&order_by=id&direction=DESC&cmd=display&status=Open',
$searches
);

Expand Down