diff --git a/gitweb.cgi b/gitweb.cgi index 0822cb1e32..f2a1526da6 100755 --- a/gitweb.cgi +++ b/gitweb.cgi @@ -12,17 +12,18 @@ use warnings; use CGI qw(:standard :escapeHTML -nosticky); use CGI::Util qw(unescape); use CGI::Carp qw(fatalsToBrowser); +use Encode; use Fcntl ':mode'; my $cgi = new CGI; my $version = "249"; 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 +38,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 +79,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,13 +208,20 @@ if (!defined $action || $action eq "summary") { exit; } -sub esc { +sub esc_url { my $str = shift; $str =~ s/\+/%2B/g; $str =~ s/ /\+/g; return $str; } +sub esc_html { + my $str = shift; + $str = escapeHTML($str); + $str = decode("utf8", $str, Encode::FB_DEFAULT); + return $str; +} + sub git_header_html { my $status = shift || "200 OK"; my $expires = shift; @@ -294,11 +302,11 @@ a.rss_logo:hover { background-color:#ee5500; } EOF print "