You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs-cvs@perl.apache.org by st...@apache.org on 2005/05/10 05:50:15 UTC

svn commit: r169414 - /perl/modperl/docs/trunk/src/docs/tutorials/client/browserbugs/browserbugs.pod

Author: stas
Date: Mon May  9 20:50:15 2005
New Revision: 169414

URL: http://svn.apache.org/viewcvs?rev=169414&view=rev
Log:
rewrite and correct the section: Preventing QUERY_STRING from getting corrupted 
because of &entity key names
Submitted by: Carl Johnstone <mo...@fadetoblack.demon.co.uk>

Modified:
    perl/modperl/docs/trunk/src/docs/tutorials/client/browserbugs/browserbugs.pod

Modified: perl/modperl/docs/trunk/src/docs/tutorials/client/browserbugs/browserbugs.pod
URL: http://svn.apache.org/viewcvs/perl/modperl/docs/trunk/src/docs/tutorials/client/browserbugs/browserbugs.pod?rev=169414&r1=169413&r2=169414&view=diff
==============================================================================
--- perl/modperl/docs/trunk/src/docs/tutorials/client/browserbugs/browserbugs.pod (original)
+++ perl/modperl/docs/trunk/src/docs/tutorials/client/browserbugs/browserbugs.pod Mon May  9 20:50:15 2005
@@ -40,17 +40,29 @@
 In a URL which contains a query string, if the string has multiple
 parts separated by ampersands and it contains a key named "reg", for
 example C<http://example.com/foo.pl?foo=bar&reg=foobar>, then some
-browsers will interpret C<&reg> as an SGML entity and encode it as
-C<&reg;>.  This will result in a corrupted C<QUERY_STRING>. If you
-encounter this problem, then either you should avoid using such keys
-or you should separate parameter pairs with C<;> instead of C<&>.
-C<CGI.pm>, C<Apache::Request> and C<$r-E<gt>args()> support a semicolon
-instead of an ampersand as a separator.  So your URI should look like
-this: C<http://example.com/foo.pl?foo=bar;reg=foobar>.
+browsers will interpret &reg as an SGML entity and encode it as
+C<&reg;>. This will result in a corrupted C<QUERY_STRING>.
+
+The behaviour is actually correct, and the problem is that you have
+not correctly encoded your ampersands into entities in your HTML. What
+you should have in the source of your HTML is
+C<http://example.com/foo.pl?foo=bar&amp;reg=foobar>.
+
+A much better, and recommended solution is to separate parameter pairs
+with C<;> instead of C<&>. C<CGI.pm>, C<Apache::Request> and
+C<$r-E<gt>args()> support a semicolon instead of an ampersand as a
+separator. So your URI should look like this:
+C<http://example.com/foo.pl?foo=bar;reg=foobar>.  Note that this is
+only an issue within HTML documents when you are building your own
+URLs with query strings. It is not a problem when the URL is the
+result of submitting a form because the browsers have to get that
+right. It is also not a problem when typing URLs directly into the
+address bar of the browser.
+
+Reference:
+http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2
+
 
-Note that this is only an issue when you are building your own URLs
-with query strings.  It is not a problem when the URL is the result 
-of submitting a form because the browsers I<have> to get that right.
 
 =head1 IE 4.x does not re-post data to a non-port-80 URL
 



---------------------------------------------------------------------
To unsubscribe, e-mail: docs-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-cvs-help@perl.apache.org