]> 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:22:38 +0000 (06:22 +0000)
committerlpsolit%gmail.com <>
Sat, 21 Oct 2006 06:22:38 +0000 (06:22 +0000)
showdependencygraph.cgi

index d2d18dd5480b0a44febeebf1bd8599cf4df4af3b..22d1c49f868767a2a3266f701ce8736559c5d947 100755 (executable)
@@ -99,7 +99,15 @@ 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';
+}
 
 if (!defined $cgi->param('id') && !defined $cgi->param('doall')) {
     ThrowCodeError("missing_bug_id");