From: Junio C Hamano Date: Fri, 02 Mar 2007 10:17:31 GMT Subject: Re: gitweb not friendly to firefox? Message-ID: <7vabyweypw.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <989B956029373F45A0B8AF02970818902DA81B@zch01exm26.fsl.freescale.net> "Li Yang-r58472" writes: > Hi Jakub, > > Problem sovled, using the following patch. I'm not an expert of perl, > so I don't know if it is problem of the gitweb or problem with my perl > environment. My environment is perl-5.8.0 and perl-CGI-2.81. > > Signed-off-by: Li Yang > --- > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl > index 653ca3c..8c9a291 100755 > --- a/gitweb/gitweb.perl > +++ b/gitweb/gitweb.perl > @@ -591,7 +591,7 @@ sub esc_html ($;%) { > my %opts = @_; > > $str = to_utf8($str); > - $str = escapeHTML($str); > + $str = $cgi->escapeHTML($str); > if ($opts{'-nbsp'}) { > $str =~ s/ / /g; > } > This is puzzling.... (1) we have two call sites of escapeHTML(), but your patch touches only one. (2) we do "use CGI qw(:standard :escapeHTML -nosticky);" upfront, presumably after doing this when we say escapeHTML() it means the same as CGI::escapeHTML(). (3) we do "$cgi = new CGI" upfront. So I am wondering how the patch can have any effect... I am not saying that I do not believe you when you say the patch fixes the problem for you. I just do not understand why and I hate not knowing why something works.