git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/4] gitweb: Make feed title valid utf8

From
Jürgen Kreileder <jk@blackdown.de>
Date
Apr 9, 2013, 17:40 UTC
Message-ID
<m2r4ija9gh.fsf@zahir.fritz.box>
In-Reply-To
<51642F67.5010501@gmail.com>
Jakub Narębski <jnareb@gmail.com> writes:
Show 25 quoted lines
> Jürgen Kreileder wrote:
>
>> Properly encode site and project names for RSS and Atom feeds.
>> 
>> Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
>> ---
>>  gitweb/gitweb.perl |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
>> index 9cfe5b5..09294eb 100755
>> --- a/gitweb/gitweb.perl
>> +++ b/gitweb/gitweb.perl
>> @@ -8056,7 +8056,7 @@ sub git_feed {
>>  	return if ($cgi->request_method() eq 'HEAD');
>>  
>>  	# header variables
>> -	my $title = "$site_name - $project/$action";
>> +	my $title = to_utf8($site_name) . " - " . to_utf8($project) . "/$action";
>>  	my $feed_type = 'log';
>>  	if (defined $hash) {
>>  		$title .= " - '$hash'";
>> 
>
> Was this patch triggered by some bug?

Yes, I actually see broken encoding with the old code, e.g on https://git.blackdown.de/old.cgi?p=contactalbum.git;a=rss my first name is messed up in the title tag.

New version: https://git.blackdown.de/?p=contactalbum.git;a=rss
Show 5 quoted lines
> Because the above is not necessary, as git_feed() has
>
> 	$title = esc_html($title);
>
> a bit later, which does to_utf8() internally.

Good point. But it doesn't fix the string in question: It looks like to_utf8("$a $b") != (to_utf8($a) . " " . to_utf($b)).

Juergen
Previous: Jakub NarębskiNext: Jakub Narębski
Message 3 of 6 in “gitweb: Make feed title valid utf8”
  1. 2/4 gitweb: Make feed title valid utf8Jürgen Kreileder, Apr 8, 2013
  2. Jakub NarębskiApr 9, 2013
  3. Jürgen KreilederApr 9, 2013
  4. Jakub NarębskiApr 9, 2013
  5. Jürgen KreilederApr 9, 2013
  6. Jakub NarębskiApr 9, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.