]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb: remove PATH_INFO from $my_url and $my_uri
[Gitweb] / gitweb.perl
index 2efd43719c8785b23b96841ed7f997e3363be810f6b8030488cddc913808d705..87c50e6e9f3fc13155de178a21e9125589f9106bbece735b8a0ee4ed8cec6a6b 100755 (executable)
@@ -27,6 +27,13 @@ our $version = "++GIT_VERSION++";
 our $my_url = $cgi->url();
 our $my_uri = $cgi->url(-absolute => 1);
 
+# if we're called with PATH_INFO, we have to strip that
+# from the URL to find our real URL
+if (my $path_info = $ENV{"PATH_INFO"}) {
+       $my_url =~ s,\Q$path_info\E$,,;
+       $my_uri =~ s,\Q$path_info\E$,,;
+}
+
 # core git executable to use
 # this can just be "git" if your webserver has a sensible PATH
 our $GIT = "++GIT_BINDIR++/git";
@@ -776,7 +783,7 @@ sub quot_cec {
        );
        my $chr = ( (exists $es{$cntrl})
                    ? $es{$cntrl}
-                   : sprintf('\%03o', ord($cntrl)) );
+                   : sprintf('\%2x', ord($cntrl)) );
        if ($opts{-nohtml}) {
                return $chr;
        } else {
This page took 0.254566 seconds and 4 git commands to generate.