]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 356328: $rankdir should be validated in showdependencygraph.cgi - Patch by Frédér...
authorlpsolit%gmail.com <>
Sat, 21 Oct 2006 06:21:08 +0000 (06:21 +0000)
committerlpsolit%gmail.com <>
Sat, 21 Oct 2006 06:21:08 +0000 (06:21 +0000)
showdependencygraph.cgi

index e483fd0f88a783d9ca28596558b0e857c0454288..2cea9b2f2d8990b1dc3b91c788eeb98917fa6322 100755 (executable)
@@ -96,7 +96,16 @@ sub AddLink {
     }
 }
 
+# The list of valid directions. Some are not proposed in the dropdrown
+# menu despite they are valid ones.
+my @valid_rankdirs = ('LR', 'RL', 'TB', 'BT');
+
 my $rankdir = $cgi->param('rankdir') || "LR";
+# Make sure the submitted 'rankdir' value is valid.
+if (lsearch(\@valid_rankdirs, $rankdir) < 0) {
+    $rankdir = 'LR';
+}
+
 my $webdotdir = bz_locations()->{'webdotdir'};
 
 if (!defined $cgi->param('id') && !defined $cgi->param('doall')) {