help-gnats
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch for "send email to interested parties"


From: Yngve Svendsen
Subject: Re: Patch for "send email to interested parties"
Date: Sat, 12 Oct 2002 01:05:57 +0200

At 20:19 11.10.2002 +0200, Yngve Svendsen wrote:
Netscape and IE handle URL quoting in different ways, and the patch would not work for Netscape browsers. I've spent a considerable amount of time devising a quoting mechanism that would work for both browsers but never got round to finishing it.

Thanks for getting me thinking about this again. I came up with the following, which seems to work OK on the (many) browsers I've tested it on.

Testing has revealed that Netscape Navigator <= 4.x is the odd one out here, since that is the only series of browsers which works with the old way Gnatsweb quoted these URLs. This patch turns the situation around, treating these browsers as special cases. Still, some 4.x releases have bugs in their handling of this kind of URL, making a workaround for _all_ Netscape 4.x browsers impossible. This patch should take care of most of them, though, while solving the problem completely for non-Netscape browsers.

This has been committed to the v4 branch of Gnatsweb.

- Yngve

Index: gnatsweb.pl
===================================================================
RCS file: /cvsroot/gnatsweb/gnatsweb/gnatsweb.pl,v
retrieving revision 1.102
diff -u -p -r1.102 gnatsweb.pl
--- gnatsweb.pl 11 Oct 2002 21:09:36 -0000      1.102
+++ gnatsweb.pl 11 Oct 2002 22:54:53 -0000
@@ -1320,6 +1320,14 @@ sub get_mailto_link
my $subject = $q->escape("Re: $fields{$CATEGORY_FIELD}/$pr: $fields{$SYNOPSIS_FIELD}");
   my $body    = $q->escape(get_viewpr_url($pr));

+  # Netscape Navigator up to and including 4.x should get the URL in
+  # the body encoded only once
+  unless ( ($ENV{'HTTP_USER_AGENT'} =~ "Mozilla\/(.)(.*)") && ($1 < 5)
+           && ($2 !=~ "compatible") )
+  {
+    $body = $q->escape($body);
+  }
+
   my $reply = "<a href=\"mailto:$int_mailto?Subject=$subject&Body=$body\";>" .
     "send email to interested parties</a>\n";




reply via email to

[Prev in Thread] Current Thread [Next in Thread]