diff options
author | Lukas Fleischer <lfleischer@archlinux.org> | 2016-04-28 08:19:25 +0200 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2016-05-10 07:25:10 +0200 |
commit | b091fb77580d56dbdca6424f9065581945b8e815 (patch) | |
tree | c0b3c99c835f25c1fb78d1d952288ae3e9daa869 /web/template | |
parent | 27ad06e3538e0ffb112b49a9edba6bd42d0e2e2d (diff) | |
download | aur-b091fb77580d56dbdca6424f9065581945b8e815.tar.gz aur-b091fb77580d56dbdca6424f9065581945b8e815.tar.xz |
Add hard limit on 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.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index 8b038b9b..b9c66d47 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"]); |