From: Jakub Narebski Date: Tue, 22 Aug 2006 09:34:46 GMT Subject: Re: [RFD] gitweb: href() function to generate URLs for CGI Message-ID: In-Reply-To: <7vodudno88.fsf@assigned-by-dhcp.cox.net> Junio C Hamano wrote: > So the last part of the above should perhaps read: > >         my @result = (); >         for (my $i = 0; $i < @mapping; $i += 2) { >                 my ($name, $symbol) = ($mapping[$i], $mapping[$i+1]); >                 if (defined $params{$name}) { >                         push @result, join('=', esc_param($symbol), >                                                 esc_param($params{$name})); >                 } >         } There is really no need to escape $symbol; we control this, and it is CGI param safe. BTW. why use join? The following push @result, "$symbol=" . esc_param($params{$name}); would be simplier... we could even use $href .= ($i > 0? ";" : "") . "$symbol=" . esc_param($params{$name}); although probably this isn't best idea (worse readibility). -- Jakub Narebski Warsaw, Poland ShadeHawk on #git