@matheusbsbs / matheus-bagliano / commits / fb3bb3d132
Fork 0

gitweb: Fix export check in git_get_projects_list

When $filter was empty, the path passed to check_export_ok would contain an extra '/', which some implementations of export_auth_hook are sensitive to. It makes more sense to fix this here than to handle the special case in each implementation of export_auth_hook. Signed-off-by: Devin Doucette <devin@doucette.cc> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Devin Doucette committed Dec 27, 2008 at 02:39 UTC fb3bb3d1325f1d0a8cdc402a596c9a520b0ccbe6
1 file changed +3 -2
gitweb/gitweb.perl
+3 -2
@@ -2147,8 +2147,9 @@ sub git_get_projects_list {
2147
2148 my $subdir = substr($File::Find::name, $pfxlen + 1);
2149 # we check related file in $projectroot
2150 - if (check_export_ok("$projectroot/$filter/$subdir")) {
2151 - push @list, { path => ($filter ? "$filter/" : '') . $subdir };
2150 + my $path = ($filter ? "$filter/" : '') . $subdir;
2151 + if (check_export_ok("$projectroot/$path")) {
2152 + push @list, { path => $path };
2153 $File::Find::prune = 1;
2154 }
2155 },