{"thread":{"id":"9628","subject":"gitweb-projects","startedAt":"2007-08-23T21:38:53Z","lastAt":"2007-08-26T00:20:11Z","messageCount":5,"participants":["Jon Smirl","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"51406","messageId":"9e4733910708231438q4c454686p55cef622e61d6a2a@mail.gmail.com","threadId":"9628","inReplyTo":null,"subject":"gitweb-projects","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2007-08-23T21:38:53Z","receivedAt":"2007-08-23T21:38:53Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"What is the magic incantation for encoding an email address along with\nthe project owner name? From the source I see these strings need to be\nURL encoded (it doesn't seem to be in the doc) but now I'm getting XML\nerrors.\n\nI tried this:\nmpc5200b.git Jon+Smirl+%3Cjonsmirl%2664%3Bgmail.com%3E\n\nDoes this string really need to be URL encoded? Couldn't you split on\nthe first space and then url encode it in the perl code? That would\nlet me write the string in English instead of geek.\n\nmpc5200b.git Jon Smirl <jonsmirl@gmail.com>\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"51411","messageId":"fal7gn$2vf$1@sea.gmane.org","threadId":"9628","inReplyTo":"9e4733910708231438q4c454686p55cef622e61d6a2a@mail.gmail.com","subject":"Re: gitweb-projects","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-08-24T00:08:24Z","receivedAt":"2007-08-24T00:08:24Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"[Cc: Jon Smirl <jonsmirl@gmail.com>, git@vger.kernel.org]\n\nJon Smirl wrote:\n\n> What is the magic incantation for encoding an email address along with\n> the project owner name? From the source I see these strings need to be\n> URL encoded (it doesn't seem to be in the doc)\n\nIt is mentioned in gitweb/INSTALL, in the \"Gitweb repositories\" section\n\n> but now I'm getting XML errors.\n>\n> I tried this:\n> mpc5200b.git Jon+Smirl+%3Cjonsmirl%2664%3Bgmail.com%3E\n\nI guess that this might have nothing to do with URL-encoding of projects\nindex file, but with proper escaping in the gitweb, i.e. the string is\nnot wrapped in esc_html.\n\nIn other words, it is a bug in the gitweb.\n\n> Does this string really need to be URL encoded? Couldn't you split on\n> the first space and then url encode it in the perl code? That would\n> let me write the string in English instead of geek.\n> \n> mpc5200b.git Jon Smirl <jonsmirl@gmail.com>\n\nNot possible, as path to repository can contain spaces.\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"51428","messageId":"200708240935.59089.jnareb@gmail.com","threadId":"9628","inReplyTo":"9e4733910708231711o71aa3953i349bce96c5eee8f0@mail.gmail.com","subject":"Re: gitweb-projects","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-08-24T07:35:57Z","receivedAt":"2007-08-24T07:35:57Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Fri, 24 August 2007, Jon Smirl wrote:\n> On 8/23/07, Jakub Narebski <jnareb@gmail.com> wrote:\n>> [Cc: Jon Smirl <jonsmirl@gmail.com>, git@vger.kernel.org]\n>>\n>> Jon Smirl wrote:\n>>\n>>> What is the magic incantation for encoding an email address along with\n>>> the project owner name? From the source I see these strings need to be\n>>> URL encoded (it doesn't seem to be in the doc)\n>>\n>> It is mentioned in gitweb/INSTALL, in the \"Gitweb repositories\" section\n\n...and in the same file it is mentioned how to generate this file\nfrom directory structure of repositories using gitweb, BTW.\n\n>>> but now I'm getting XML errors.\n>>>\n>>> I tried this:\n>>> mpc5200b.git Jon+Smirl+%3Cjonsmirl%2664%3Bgmail.com%3E\n\nI think you don't need to escape '<', '>' and '@' here. The problem\nwas not with URL-escaping (or unescaping) the source, i.e. projects\nlist (projects index) file, but with proper HTML escaping when writing\nit out: see patch below.\n\nIt would be enough to use\n\nmpc5200b.git Jon+Smirl+<jonsmirl@gmail.com>\n\n>> I guess that this might have nothing to do with URL-encoding of projects\n>> index file, but with proper escaping in the gitweb, i.e. the string is\n>> not wrapped in esc_html.\n>>\n>> In other words, it is a bug in the gitweb.\n\nPlease check if the patch below fixes your problem.\n\n>>> Does this string really need to be URL encoded? Couldn't you split on\n>>> the first space and then url encode it in the perl code? That would\n>>> let me write the string in English instead of geek.\n>>>\n>>> mpc5200b.git Jon Smirl <jonsmirl@gmail.com>\n>>\n>> Not possible, as path to repository can contain spaces.\n> \n> How about using a comma to separate them? Or let me quote the string?\n\nThe problem is that path to repository part can contain _any_ characters\nexcept '\\0'. The quoting would work, but splitting into path part (which\nmight need quoting) and owner part (which might also need quoting) is\nnon-trivial.\n\nBTW. the URL-escaping is from original gitweb...\n\n-- >8 --\nFrom: Jakub Narebski <jnareb@gmail.com>\nDate: Fri, 24 Aug 2007 09:12:16 +0200\nSubject: [PATCH] gitweb: Fix escaping HTML of project owner in 'projects_list' and 'summary' views\n\nThis for example allows to put email address in the project owner\nfield in the projects index file (when $projects_list points to\nfile, and not directory), in the form of:\n\npath/to/repo.git Random+J+Developer+<random@developer.example.org>\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\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 f282a67..9bee68e 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -3422,7 +3422,7 @@ sub git_project_list_body {\n \t\t      \"<td>\" . $cgi->a({-href => href(project=>$pr->{'path'}, action=>\"summary\"),\n \t\t                        -class => \"list\", -title => $pr->{'descr_long'}},\n \t\t                        esc_html($pr->{'descr'})) . \"</td>\\n\" .\n-\t\t      \"<td><i>\" . chop_str($pr->{'owner'}, 15) . \"</i></td>\\n\";\n+\t\t      \"<td><i>\" . esc_html(chop_str($pr->{'owner'}, 15)) . \"</i></td>\\n\";\n \t\tprint \"<td class=\\\"\". age_class($pr->{'age'}) . \"\\\">\" .\n \t\t      (defined $pr->{'age_string'} ? $pr->{'age_string'} : \"No commits\") . \"</td>\\n\" .\n \t\t      \"<td class=\\\"link\\\">\" .\n@@ -3798,7 +3798,7 @@ sub git_summary {\n \tprint \"<div class=\\\"title\\\">&nbsp;</div>\\n\";\n \tprint \"<table cellspacing=\\\"0\\\">\\n\" .\n \t      \"<tr><td>description</td><td>\" . esc_html($descr) . \"</td></tr>\\n\" .\n-\t      \"<tr><td>owner</td><td>$owner</td></tr>\\n\";\n+\t      \"<tr><td>owner</td><td>\" . esc_html($owner) . \"</td></tr>\\n\";\n \tif (defined $cd{'rfc2822'}) {\n \t\tprint \"<tr><td>last change</td><td>$cd{'rfc2822'}</td></tr>\\n\";\n \t}\n-- \n1.5.2.5\n"},{"id":"51534","messageId":"9e4733910708251716r1c131b0aka3014a6011b9ebd4@mail.gmail.com","threadId":"9628","inReplyTo":"200708240935.59089.jnareb@gmail.com","subject":"Re: gitweb-projects","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2007-08-26T00:16:21Z","receivedAt":"2007-08-26T00:16:21Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"Another HTML escaping problem, I can't use an @ sign in the hometext.html file.\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"51535","messageId":"9e4733910708251720x79e54ae3m69d8e4d1e5532a02@mail.gmail.com","threadId":"9628","inReplyTo":"9e4733910708251716r1c131b0aka3014a6011b9ebd4@mail.gmail.com","subject":"Re: gitweb-projects","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2007-08-26T00:20:11Z","receivedAt":"2007-08-26T00:20:11Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"On 8/25/07, Jon Smirl <jonsmirl@gmail.com> wrote:\n> Another HTML escaping problem, I can't use an @ sign in the hometext.html file.\n\nhometext.html is really a misnomer, it needs XHTML syntax, not HTML.\n\n>\n> --\n> Jon Smirl\n> jonsmirl@gmail.com\n>\n\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"}]}