diff options
author | lukehamburg <luke.hamburg@gmail.com> | 2016-07-15 21:25:11 -0400 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2016-07-16 00:29:55 -0500 |
commit | 47de3b0678d06d71c72c69647bdd920ef97d4735 (patch) | |
tree | 1d3c87f17ed4f5cfec6f0f0dd4358c7b43970a08 | |
parent | 4e0f1a1e9c17b50a4d7c4ce6d8ff1acf19eb3d9c (diff) | |
download | pfsense-47de3b0678d06d71c72c69647bdd920ef97d4735.zip pfsense-47de3b0678d06d71c72c69647bdd920ef97d4735.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.
-rw-r--r-- | src/usr/local/www/pkg_mgr.php | 8 |
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 f896cfc..af29aca 100644 --- a/src/usr/local/www/pkg_mgr.php +++ b/src/usr/local/www/pkg_mgr.php @@ -110,12 +110,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"; |