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

Re: [PATCH] gitweb: Call to_utf8() on input string in chop_and_escape_str()

From
Jürgen Kreileder <jk@blackdown.de>
Date
Nov 29, 2011, 22:14 UTC
Message-ID
<CAKD0Uuw64bRryYpVbp0G7HNjZHgHUsnSMH3g3gWF-Jv9dWA04Q@mail.gmail.com>
In-Reply-To
<201111292250.04800.jnareb@gmail.com>
On Tue, Nov 29, 2011 at 22:50, Jakub Narebski <jnareb@gmail.com> wrote:
Show 21 quoted lines
> Jürgen Kreileder wrote:
>
>> a) To fix the comparison with the chopped string
>> b) To give the title attribute correct encoding
>>
>> Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
>> ---
>>  gitweb/gitweb.perl |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
>> index 4f0c3bd..4237ea6 100755
>> --- a/gitweb/gitweb.perl
>> +++ b/gitweb/gitweb.perl
>> @@ -1695,11 +1695,11 @@ sub chop_and_escape_str {
>>       my ($str) = @_;
>
> Why not simply
>
>        my $str = to_utf8(shift);
>

Good question. Because I thought it broke something when I tested it. I can't reproduce that now, though. Might have been something unrelated. So:

-- >8 --
Subject: [PATCH] gitweb: Call to_utf8() on input string in
 chop_and_escape_str()

a) To fix the comparison with the chopped string b) To give the title attribute correct encoding

Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
---
 gitweb/gitweb.perl |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index bfada0e..036ae46 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1699,6 +1699,7 @@ sub chop_and_escape_str {
 	my ($str) = @_;

 	my $chopped = chop_str(@_);
+	$str = to_utf8($str);
 	if ($chopped eq $str) {
 		return esc_html($chopped);
 	} else {
-- 
1.7.5.4
Previous: Jakub Narebski
Message 3 of 3 in “gitweb: Call to_utf8() on input string in chop_and_escape_str()”
  1. gitweb: Call to_utf8() on input string in chop_and_escape_str()Jürgen Kreileder, Nov 29, 2011
  2. Jakub NarebskiNov 29, 2011
  3. Jürgen KreilederNov 29, 2011

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.