From: Giuseppe Bilotta Date: Sun, 21 Sep 2008 20:57:43 GMT Subject: [PATCH 6/6] gitweb: prevent double slashes in PATH_INFO hrefs Message-ID: <1222030663-22540-7-git-send-email-giuseppe.bilotta@gmail.com> In-Reply-To: <1222030663-22540-6-git-send-email-giuseppe.bilotta@gmail.com> When using PATH_INFO in combination with a rewrite rule that hides the cgi script name, links to projects and/or actions without projects might be generated with a double slash. Fix by removing the trailing slash (if present) from $href before appending PATH_INFO data. Signed-off-by: Giuseppe Bilotta --- gitweb/gitweb.perl | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 4a91d07..ebab86b 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -675,6 +675,8 @@ sub href (%) { my ($use_pathinfo) = gitweb_check_feature('pathinfo'); if ($use_pathinfo) { + $href =~ s,/$,,; + # use PATH_INFO for project name $href .= "/".esc_url($params{'project'}) if defined $params{'project'}; delete $params{'project'}; -- 1.5.6.5