* gitweb-projects
@ 2007-08-23 21:38 Jon Smirl
2007-08-24 0:08 ` gitweb-projects Jakub Narebski
0 siblings, 1 reply; 5+ messages in thread
From: Jon Smirl @ 2007-08-23 21:38 UTC (permalink / raw)
To: Git Mailing List
What is the magic incantation for encoding an email address along with
the project owner name? From the source I see these strings need to be
URL encoded (it doesn't seem to be in the doc) but now I'm getting XML
errors.
I tried this:
mpc5200b.git Jon+Smirl+%3Cjonsmirl%2664%3Bgmail.com%3E
Does this string really need to be URL encoded? Couldn't you split on
the first space and then url encode it in the perl code? That would
let me write the string in English instead of geek.
mpc5200b.git Jon Smirl <jonsmirl@gmail.com>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: gitweb-projects
2007-08-23 21:38 gitweb-projects Jon Smirl
@ 2007-08-24 0:08 ` Jakub Narebski
[not found] ` <9e4733910708231711o71aa3953i349bce96c5eee8f0@mail.gmail.com>
0 siblings, 1 reply; 5+ messages in thread
From: Jakub Narebski @ 2007-08-24 0:08 UTC (permalink / raw)
To: git
[Cc: Jon Smirl <jonsmirl@gmail.com>, git@vger.kernel.org]
Jon Smirl wrote:
> What is the magic incantation for encoding an email address along with
> the project owner name? From the source I see these strings need to be
> URL encoded (it doesn't seem to be in the doc)
It is mentioned in gitweb/INSTALL, in the "Gitweb repositories" section
> but now I'm getting XML errors.
>
> I tried this:
> mpc5200b.git Jon+Smirl+%3Cjonsmirl%2664%3Bgmail.com%3E
I guess that this might have nothing to do with URL-encoding of projects
index file, but with proper escaping in the gitweb, i.e. the string is
not wrapped in esc_html.
In other words, it is a bug in the gitweb.
> Does this string really need to be URL encoded? Couldn't you split on
> the first space and then url encode it in the perl code? That would
> let me write the string in English instead of geek.
>
> mpc5200b.git Jon Smirl <jonsmirl@gmail.com>
Not possible, as path to repository can contain spaces.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: gitweb-projects
[not found] ` <9e4733910708231711o71aa3953i349bce96c5eee8f0@mail.gmail.com>
@ 2007-08-24 7:35 ` Jakub Narebski
2007-08-26 0:16 ` gitweb-projects Jon Smirl
0 siblings, 1 reply; 5+ messages in thread
From: Jakub Narebski @ 2007-08-24 7:35 UTC (permalink / raw)
To: Jon Smirl, git; +Cc: Junio Hamano
On Fri, 24 August 2007, Jon Smirl wrote:
> On 8/23/07, Jakub Narebski <jnareb@gmail.com> wrote:
>> [Cc: Jon Smirl <jonsmirl@gmail.com>, git@vger.kernel.org]
>>
>> Jon Smirl wrote:
>>
>>> What is the magic incantation for encoding an email address along with
>>> the project owner name? From the source I see these strings need to be
>>> URL encoded (it doesn't seem to be in the doc)
>>
>> It is mentioned in gitweb/INSTALL, in the "Gitweb repositories" section
...and in the same file it is mentioned how to generate this file
from directory structure of repositories using gitweb, BTW.
>>> but now I'm getting XML errors.
>>>
>>> I tried this:
>>> mpc5200b.git Jon+Smirl+%3Cjonsmirl%2664%3Bgmail.com%3E
I think you don't need to escape '<', '>' and '@' here. The problem
was not with URL-escaping (or unescaping) the source, i.e. projects
list (projects index) file, but with proper HTML escaping when writing
it out: see patch below.
It would be enough to use
mpc5200b.git Jon+Smirl+<jonsmirl@gmail.com>
>> I guess that this might have nothing to do with URL-encoding of projects
>> index file, but with proper escaping in the gitweb, i.e. the string is
>> not wrapped in esc_html.
>>
>> In other words, it is a bug in the gitweb.
Please check if the patch below fixes your problem.
>>> Does this string really need to be URL encoded? Couldn't you split on
>>> the first space and then url encode it in the perl code? That would
>>> let me write the string in English instead of geek.
>>>
>>> mpc5200b.git Jon Smirl <jonsmirl@gmail.com>
>>
>> Not possible, as path to repository can contain spaces.
>
> How about using a comma to separate them? Or let me quote the string?
The problem is that path to repository part can contain _any_ characters
except '\0'. The quoting would work, but splitting into path part (which
might need quoting) and owner part (which might also need quoting) is
non-trivial.
BTW. the URL-escaping is from original gitweb...
-- >8 --
From: Jakub Narebski <jnareb@gmail.com>
Date: Fri, 24 Aug 2007 09:12:16 +0200
Subject: [PATCH] gitweb: Fix escaping HTML of project owner in 'projects_list' and 'summary' views
This for example allows to put email address in the project owner
field in the projects index file (when $projects_list points to
file, and not directory), in the form of:
path/to/repo.git Random+J+Developer+<random@developer.example.org>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
gitweb/gitweb.perl | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index f282a67..9bee68e 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3422,7 +3422,7 @@ sub git_project_list_body {
"<td>" . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"summary"),
-class => "list", -title => $pr->{'descr_long'}},
esc_html($pr->{'descr'})) . "</td>\n" .
- "<td><i>" . chop_str($pr->{'owner'}, 15) . "</i></td>\n";
+ "<td><i>" . esc_html(chop_str($pr->{'owner'}, 15)) . "</i></td>\n";
print "<td class=\"". age_class($pr->{'age'}) . "\">" .
(defined $pr->{'age_string'} ? $pr->{'age_string'} : "No commits") . "</td>\n" .
"<td class=\"link\">" .
@@ -3798,7 +3798,7 @@ sub git_summary {
print "<div class=\"title\"> </div>\n";
print "<table cellspacing=\"0\">\n" .
"<tr><td>description</td><td>" . esc_html($descr) . "</td></tr>\n" .
- "<tr><td>owner</td><td>$owner</td></tr>\n";
+ "<tr><td>owner</td><td>" . esc_html($owner) . "</td></tr>\n";
if (defined $cd{'rfc2822'}) {
print "<tr><td>last change</td><td>$cd{'rfc2822'}</td></tr>\n";
}
--
1.5.2.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: gitweb-projects
2007-08-24 7:35 ` gitweb-projects Jakub Narebski
@ 2007-08-26 0:16 ` Jon Smirl
2007-08-26 0:20 ` gitweb-projects Jon Smirl
0 siblings, 1 reply; 5+ messages in thread
From: Jon Smirl @ 2007-08-26 0:16 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git, Junio Hamano
Another HTML escaping problem, I can't use an @ sign in the hometext.html file.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: gitweb-projects
2007-08-26 0:16 ` gitweb-projects Jon Smirl
@ 2007-08-26 0:20 ` Jon Smirl
0 siblings, 0 replies; 5+ messages in thread
From: Jon Smirl @ 2007-08-26 0:20 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git, Junio Hamano
On 8/25/07, Jon Smirl <jonsmirl@gmail.com> wrote:
> Another HTML escaping problem, I can't use an @ sign in the hometext.html file.
hometext.html is really a misnomer, it needs XHTML syntax, not HTML.
>
> --
> Jon Smirl
> jonsmirl@gmail.com
>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-08-26 0:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-23 21:38 gitweb-projects Jon Smirl
2007-08-24 0:08 ` gitweb-projects Jakub Narebski
[not found] ` <9e4733910708231711o71aa3953i349bce96c5eee8f0@mail.gmail.com>
2007-08-24 7:35 ` gitweb-projects Jakub Narebski
2007-08-26 0:16 ` gitweb-projects Jon Smirl
2007-08-26 0:20 ` gitweb-projects Jon Smirl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).