summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorlukehamburg <luke.hamburg@gmail.com>2016-07-15 21:25:11 -0400
committerGitHub <noreply@github.com>2016-07-15 21:25:11 -0400
commit7940050bb9b1e7a24b8dd225da1a7aa2a0e158dc (patch)
treebb0d322ec87332ac428c55f6d37bfdf775157743 /src/usr
parent1d653e869b05e015105427516b41d5a7ac76b2eb (diff)
downloadpfsense-7940050bb9b1e7a24b8dd225da1a7aa2a0e158dc.zip
pfsense-7940050bb9b1e7a24b8dd225da1a7aa2a0e158dc.tar.gz
Fix "http://pf.sense/UNKNOWN" links in Pkg Manager
I noticed recently that many packages do not have the 'www' field in the database filled, or have it set to UNKNOWN The way the table is built, this causes bad links to be generated pointing to e.g. http://pf.sense/UNKNOWN. This patch fixes it, causing only packages with actual links to get the <a> tag.
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/local/www/pkg_mgr.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/usr/local/www/pkg_mgr.php b/src/usr/local/www/pkg_mgr.php
index 0431e85..4326471 100644
--- a/src/usr/local/www/pkg_mgr.php
+++ b/src/usr/local/www/pkg_mgr.php
@@ -78,12 +78,12 @@ function get_pkg_table() {
$pkgtbl .= '<tr>' . "\n";
$pkgtbl .= '<td>' . "\n";
- if ($index['www']) {
+ if (($index['www']) && ($index['www'] != "UNKNOWN")) {
$pkgtbl .= '<a title="' . gettext("Visit official website") . '" target="_blank" href="' . htmlspecialchars($index['www']) . '">' . "\n";
+ $pkgtbl .= htmlspecialchars($index['shortname']) . '</a>' . "\n";
+ } else {
+ $pkgtbl .= htmlspecialchars($index['shortname']);
}
-
- $pkgtbl .= htmlspecialchars($index['shortname']);
- $pkgtbl .= '</a>' . "\n";
$pkgtbl .= '</td>' . "\n";
$pkgtbl .= '<td>' . "\n";
OpenPOWER on IntegriCloud