X-Git-Url: https://git.ladys.computer/Gitweb/blobdiff_plain/21c87306300eed8561e6af5e9316be773e2565053498c4c112e88e219055e5f2..4fbcadea1e38491f95abe4219c3ebd23249b7cbbd7df3290917318d3054ab673:/gitweb.cgi diff --git a/gitweb.cgi b/gitweb.cgi index bacdfd8..67345d6 100755 --- a/gitweb.cgi +++ b/gitweb.cgi @@ -12,17 +12,19 @@ use warnings; use CGI qw(:standard :escapeHTML -nosticky); use CGI::Util qw(unescape); use CGI::Carp qw(fatalsToBrowser); +use Encode; use Fcntl ':mode'; +binmode STDOUT, ':utf8'; my $cgi = new CGI; -my $version = "249"; +my $version = "253"; my $my_url = $cgi->url(); my $my_uri = $cgi->url(-absolute => 1); -my $rss_link = ""; +my $rss_link = ""; # absolute fs-path which will be prepended to the project path #my $projectroot = "/pub/scm"; -my $projectroot = "/home/kay/public_html/pub/scm"; +my $projectroot = "/home/kay/public_html/pub/scm"; # location of the git-core binaries my $gitbin = "/usr/bin"; @@ -37,8 +39,8 @@ my $home_link = $my_uri; my $home_text = "indextext.html"; # source of projects list -#my $projects_list = $projectroot; -my $projects_list = "index/index.aux"; +#my $projects_list = $projectroot; +my $projects_list = "index/index.aux"; # input validation and dispatch my $action = $cgi->param('a'); @@ -78,8 +80,8 @@ if (defined $project) { undef $project; die_error(undef, "No such project."); } - $rss_link = ""; + $rss_link = ""; $ENV{'GIT_DIR'} = "$projectroot/$project"; } else { git_project_list(); @@ -207,10 +209,17 @@ if (!defined $action || $action eq "summary") { exit; } -sub esc { +sub esc_url { my $str = shift; - $str =~ s/ /%20/g; $str =~ s/\+/%2B/g; + $str =~ s/ /\+/g; + return $str; +} + +sub esc_html { + my $str = shift; + $str = decode("utf8", $str, Encode::FB_DEFAULT); + $str = escapeHTML($str); return $str; } @@ -294,11 +303,11 @@ a.rss_logo:hover { background-color:#ee5500; } EOF print "