]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 345405: showdependencygraph.cgi: Dependency Graphs are broken on mod_perl
authormkanat%bugzilla.org <>
Sat, 16 Dec 2006 09:47:12 +0000 (09:47 +0000)
committermkanat%bugzilla.org <>
Sat, 16 Dec 2006 09:47:12 +0000 (09:47 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=myk

Bugzilla/Constants.pm
showdependencygraph.cgi

index 9e37f9f5c4475dd58b44f7dd51c5a62def7aca1f..67e0a92252ea1ddd0e4600066e7aad858ad1d6b0 100644 (file)
@@ -433,7 +433,7 @@ sub bz_locations {
         # change showdependencygraph.cgi to set image_url to the correct 
         # location.
         # The script should really generate these graphs directly...
-        'webdotdir'   => "$datadir/webdot",
+        'webdotdir'   => "$libpath/$datadir/webdot",
         'extensionsdir' => "$libpath/extensions",
     };
 }
index 2cea9b2f2d8990b1dc3b91c788eeb98917fa6322..77259182f8e13a075351e1c647d2d8889afddd0a 100755 (executable)
@@ -247,6 +247,11 @@ if ($webdotbase =~ /^https?:/) {
     
     # On Windows $pngfilename will contain \ instead of /
     $pngfilename =~ s|\\|/|g if $^O eq 'MSWin32';
+
+    # Under mod_perl, pngfilename will have an absolute path, and we
+    # need to make that into a relative path.
+    my $cgi_root = bz_locations()->{cgi_path};
+    $pngfilename =~ s/^\Q$cgi_root\E//;
     
     $vars->{'image_url'} = $pngfilename;