From 7940050bb9b1e7a24b8dd225da1a7aa2a0e158dc Mon Sep 17 00:00:00 2001 From: lukehamburg Date: Fri, 15 Jul 2016 21:25:11 -0400 Subject: 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 tag. --- src/usr/local/www/pkg_mgr.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/usr') 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 .= '' . "\n"; $pkgtbl .= '' . "\n"; - if ($index['www']) { + if (($index['www']) && ($index['www'] != "UNKNOWN")) { $pkgtbl .= '' . "\n"; + $pkgtbl .= htmlspecialchars($index['shortname']) . '' . "\n"; + } else { + $pkgtbl .= htmlspecialchars($index['shortname']); } - - $pkgtbl .= htmlspecialchars($index['shortname']); - $pkgtbl .= '' . "\n"; $pkgtbl .= '' . "\n"; $pkgtbl .= '' . "\n"; -- cgit v1.1