From fbf3e5405781f0f7ded67e99ab83bebc0737499d Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Thu, 28 Apr 2016 19:28:23 +0200 Subject: Add hard limit for the length of dependency lists Introduce a configuration option max_depends which can be used to specify a maximum number of (reverse) dependencies to display on the package details pages. Fixes FS#49059. Signed-off-by: Lukas Fleischer --- web/template/pkg_details.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'web/template') diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index 8b038b9..b9c66d4 100644 --- a/web/template/pkg_details.php +++ b/web/template/pkg_details.php @@ -5,6 +5,7 @@ $log_uri = sprintf(config_get('options', 'log_uri'), urlencode($row['BaseName']) $snapshot_uri = sprintf(config_get('options', 'snapshot_uri'), urlencode($row['BaseName'])); $git_clone_uri_anon = sprintf(config_get('options', 'git_clone_uri_anon'), htmlspecialchars($row['BaseName'])); $git_clone_uri_priv = sprintf(config_get('options', 'git_clone_uri_priv'), htmlspecialchars($row['BaseName'])); +$max_depends = config_get_int('options', 'max_depends'); $uid = uid_from_sid($SID); @@ -40,7 +41,7 @@ $out_of_date_time = ($row["OutOfDateTS"] == 0) ? $msg : gmdate("Y-m-d", intval($ $lics = pkg_licenses($row["ID"]); $grps = pkg_groups($row["ID"]); -$deps = pkg_dependencies($row["ID"]); +$deps = pkg_dependencies($row["ID"], $max_depends); usort($deps, function($x, $y) { if ($x[1] != $y[1]) { @@ -82,7 +83,7 @@ foreach ($rels as $rel) { } } -$requiredby = pkg_required($row["Name"], $rels_p); +$requiredby = pkg_required($row["Name"], $rels_p, $max_depends); # $sources[0] = 'src'; $sources = pkg_sources($row["ID"]); -- cgit v1.2.3-54-g00ecf