{"thread":{"id":"29045","subject":"[PATCH] gitweb: Call to_utf8() on input string in chop_and_escape_str()","startedAt":"2011-11-29T21:41:40Z","lastAt":"2011-11-29T22:14:34Z","messageCount":3,"participants":["Jürgen Kreileder","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"180116","messageId":"CAKD0Uuy8y7Dc6gfvYVe-FJ=Reiu0M3wOY4r4VVPtEYmahZcdwA@mail.gmail.com","threadId":"29045","inReplyTo":null,"subject":"[PATCH] gitweb: Call to_utf8() on input string in chop_and_escape_str()","fromName":"Jürgen Kreileder","fromEmail":"jk@blackdown.de","sentAt":"2011-11-29T21:41:40Z","receivedAt":"2011-11-29T21:41:40Z","isPatch":true,"sender":{"key":"jk@blackdown.de","avatar":"https://avatars.githubusercontent.com/u/4390544?v=4"},"body":"a) To fix the comparison with the chopped string\nb) To give the title attribute correct encoding\n\nSigned-off-by: Jürgen Kreileder <jk@blackdown.de>\n---\n gitweb/gitweb.perl |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 4f0c3bd..4237ea6 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1695,11 +1695,11 @@ sub chop_and_escape_str {\n \tmy ($str) = @_;\n\n \tmy $chopped = chop_str(@_);\n-\tif ($chopped eq $str) {\n+\tif ($chopped eq to_utf8($str)) {\n \t\treturn esc_html($chopped);\n \t} else {\n \t\t$str =~ s/[[:cntrl:]]/?/g;\n-\t\treturn $cgi->span({-title=>$str}, esc_html($chopped));\n+\t\treturn $cgi->span({-title => to_utf8($str)}, esc_html($chopped));\n \t}\n }\n\n-- \n1.7.5.4\n"},{"id":"180118","messageId":"201111292250.04800.jnareb@gmail.com","threadId":"29045","inReplyTo":"CAKD0Uuy8y7Dc6gfvYVe-FJ=Reiu0M3wOY4r4VVPtEYmahZcdwA@mail.gmail.com","subject":"Re: [PATCH] gitweb: Call to_utf8() on input string in chop_and_escape_str()","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-11-29T21:50:03Z","receivedAt":"2011-11-29T21:50:03Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Jürgen Kreileder wrote:\n\n> a) To fix the comparison with the chopped string\n> b) To give the title attribute correct encoding\n> \n> Signed-off-by: Jürgen Kreileder <jk@blackdown.de>\n> ---\n>  gitweb/gitweb.perl |    4 ++--\n>  1 files changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index 4f0c3bd..4237ea6 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -1695,11 +1695,11 @@ sub chop_and_escape_str {\n>  \tmy ($str) = @_;\n\nWhy not simply\n\n  \tmy $str = to_utf8(shift);\n \n>  \tmy $chopped = chop_str(@_);\n> -\tif ($chopped eq $str) {\n> +\tif ($chopped eq to_utf8($str)) {\n>  \t\treturn esc_html($chopped);\n>  \t} else {\n>  \t\t$str =~ s/[[:cntrl:]]/?/g;\n> -\t\treturn $cgi->span({-title=>$str}, esc_html($chopped));\n> +\t\treturn $cgi->span({-title => to_utf8($str)}, esc_html($chopped));\n>  \t}\n>  }\n> \n> -- \n> 1.7.5.4\n> \n\n-- \nJakub Narebski\nPoland\n"},{"id":"180123","messageId":"CAKD0Uuw64bRryYpVbp0G7HNjZHgHUsnSMH3g3gWF-Jv9dWA04Q@mail.gmail.com","threadId":"29045","inReplyTo":"201111292250.04800.jnareb@gmail.com","subject":"Re: [PATCH] gitweb: Call to_utf8() on input string in chop_and_escape_str()","fromName":"Jürgen Kreileder","fromEmail":"jk@blackdown.de","sentAt":"2011-11-29T22:14:34Z","receivedAt":"2011-11-29T22:14:34Z","isPatch":true,"sender":{"key":"jk@blackdown.de","avatar":"https://avatars.githubusercontent.com/u/4390544?v=4"},"body":"On Tue, Nov 29, 2011 at 22:50, Jakub Narebski <jnareb@gmail.com> wrote:\n> Jürgen Kreileder wrote:\n>\n>> a) To fix the comparison with the chopped string\n>> b) To give the title attribute correct encoding\n>>\n>> Signed-off-by: Jürgen Kreileder <jk@blackdown.de>\n>> ---\n>>  gitweb/gitweb.perl |    4 ++--\n>>  1 files changed, 2 insertions(+), 2 deletions(-)\n>>\n>> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n>> index 4f0c3bd..4237ea6 100755\n>> --- a/gitweb/gitweb.perl\n>> +++ b/gitweb/gitweb.perl\n>> @@ -1695,11 +1695,11 @@ sub chop_and_escape_str {\n>>       my ($str) = @_;\n>\n> Why not simply\n>\n>        my $str = to_utf8(shift);\n>\n\nGood question.  Because I thought it broke something when I tested it.\nI can't reproduce that now, though.  Might have been something unrelated.\nSo:\n\n-- >8 --\nSubject: [PATCH] gitweb: Call to_utf8() on input string in\n chop_and_escape_str()\n\na) To fix the comparison with the chopped string\nb) To give the title attribute correct encoding\n\nSigned-off-by: Jürgen Kreileder <jk@blackdown.de>\n---\n gitweb/gitweb.perl |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex bfada0e..036ae46 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1699,6 +1699,7 @@ sub chop_and_escape_str {\n \tmy ($str) = @_;\n\n \tmy $chopped = chop_str(@_);\n+\t$str = to_utf8($str);\n \tif ($chopped eq $str) {\n \t\treturn esc_html($chopped);\n \t} else {\n-- \n1.7.5.4\n"}]}