summaryrefslogtreecommitdiffstats
path: root/showdependencygraph.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'showdependencygraph.cgi')
-rwxr-xr-xshowdependencygraph.cgi16
1 files changed, 12 insertions, 4 deletions
diff --git a/showdependencygraph.cgi b/showdependencygraph.cgi
index 71eaa9183..28b113460 100755
--- a/showdependencygraph.cgi
+++ b/showdependencygraph.cgi
@@ -44,7 +44,8 @@ my $vars = {};
# performance.
my $dbh = Bugzilla->switch_to_shadow_db();
-local our (%seen, %edgesdone, %bugtitles);
+our (%seen, %edgesdone, %bugtitles);
+our $bug_count = 0;
# 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
@@ -91,6 +92,7 @@ sub AddLink {
if (!exists $edgesdone{$key}) {
$edgesdone{$key} = 1;
print $fh "$dependson -> $blocked\n";
+ $bug_count++;
$seen{$blocked} = 1;
$seen{$dependson} = 1;
}
@@ -123,10 +125,10 @@ chmod Bugzilla::Install::Filesystem::CGI_WRITE, $filename
my $urlbase = correct_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;
@@ -236,6 +238,11 @@ foreach my $k (keys(%seen)) {
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?:/) {
@@ -311,7 +318,8 @@ foreach my $f (@files)
# symlinks), this can't escape to delete anything it shouldn't
# (unless someone moves the location of $webdotdir, of course)
trick_taint($f);
- if (file_mod_time($f) < $since) {
+ my $mtime = file_mod_time($f);
+ if ($mtime && $mtime < $since) {
unlink $f;
}
}