summaryrefslogtreecommitdiffstats
path: root/web/template
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2016-04-28 19:28:23 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2016-06-26 08:53:55 +0200
commitfbf3e5405781f0f7ded67e99ab83bebc0737499d (patch)
treef1e0a2ea3259f8f7455e4a1839be1908d42808ab /web/template
parent0350de4b422b06e99ce769ba03d451577ecb0ee8 (diff)
downloadaurweb-fbf3e5405781f0f7ded67e99ab83bebc0737499d.tar.xz
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 <lfleischer@archlinux.org>
Diffstat (limited to 'web/template')
-rw-r--r--web/template/pkg_details.php5
1 files changed, 3 insertions, 2 deletions
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"]);