summaryrefslogtreecommitdiffstats
path: root/showdependencygraph.cgi
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-03-28 07:16:58 +0100
committerByron Jones <bjones@mozilla.com>2013-03-28 07:16:58 +0100
commit00ff400464fca420e0cc7e7ce402d9e9bd3ea8ec (patch)
tree92be84fad5bb9abecb3193c2053720a57d2b721b /showdependencygraph.cgi
parentf5e0b805e282d047dfac17e6ba1034b19832b61d (diff)
downloadbugzilla-00ff400464fca420e0cc7e7ce402d9e9bd3ea8ec.tar.gz
bugzilla-00ff400464fca420e0cc7e7ce402d9e9bd3ea8ec.tar.xz
Bug 850639: Set an upper limit on the number of nodes the dependency graph will display
r=LpSolit, a=LpSolit
Diffstat (limited to 'showdependencygraph.cgi')
-rwxr-xr-xshowdependencygraph.cgi12
1 files changed, 9 insertions, 3 deletions
diff --git a/showdependencygraph.cgi b/showdependencygraph.cgi
index 2f10551a1..838402a8e 100755
--- a/showdependencygraph.cgi
+++ b/showdependencygraph.cgi
@@ -29,7 +29,7 @@ my $vars = {};
# performance.
my $dbh = Bugzilla->switch_to_shadow_db();
-local our (%seen, %edgesdone, %bugtitles);
+our (%seen, %edgesdone, %bugtitles, $bug_count);
# CreateImagemap: This sub grabs a local filename as a parameter, reads the
# dot-generated image map datafile residing in that file and turns it into
@@ -76,6 +76,7 @@ sub AddLink {
if (!exists $edgesdone{$key}) {
$edgesdone{$key} = 1;
print $fh "$dependson -> $blocked\n";
+ $bug_count++;
$seen{$blocked} = 1;
$seen{$dependson} = 1;
}
@@ -108,10 +109,10 @@ chmod Bugzilla::Install::Filesystem::CGI_WRITE, $filename
my $urlbase = Bugzilla->params->{'urlbase'};
print $fh "digraph G {";
-print $fh qq{
+print $fh qq(
graph [URL="${urlbase}query.cgi", rankdir=$rankdir]
node [URL="${urlbase}show_bug.cgi?id=\\N", style=filled, color=lightgrey]
-};
+);
my %baselist;
@@ -224,6 +225,11 @@ foreach my $k (@bug_ids) {
print $fh "}\n";
close $fh;
+if ($bug_count > MAX_WEBDOT_BUGS) {
+ unlink($filename);
+ ThrowUserError("webdot_too_large");
+}
+
my $webdotbase = Bugzilla->params->{'webdotbase'};
if ($webdotbase =~ /^https?:/) {