We've been converting a site using Apache::Registry and CGI.pm over to
Embperl v1.3.x, and we ran into a problem getting Embperl to accept some
query strings that CGI.pm would accept (and create).
It seems that w3c recommends that CGI libraries accept both semicolons
';' in addition to ampersands '&' as form field separators in
application/x-www-form-urlencoded query strings. Quite a few places on
the site we construct URI's like /events?year=2001;month=6 instead of
/events?year=2001&month=6, and CGI.pm has accepted them. See:
http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2
However, CGI.pm will not only accept semicolons as form field
separators, but will also construct query strings with semicolons by
default. This is probably incorrect behavior:
http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#form-content-type
But, it's the behavior of CGI.pm, and it could be argued that not
accepting the ';' is probably incorrect also.
Rfc2396 (the URI generic syntax) is silent on this issue -- it just says
in section 3.4:
> Within a query component, the characters ";", "/", "?", ":", "@",
"&", "=", "+", ",", and "$" are reserved.
So, the use of the ampersand vs. the semicolon as the form field
separator is akin to using the "+" as a space -- the rfc is silent on
the issue, saying only that the characters are reserved, and leaving
their meaning entirely up to whoever defines the MIME type
application/x-www-form-urlencoded.
Anyhow, I'm just trying to work up to the justification for this patch,
which modifies the function "GetFormData" so that in addition to the
already correct behaviour of accepting "&" as a form field seperator, it
is made even more correct by accepting ";".
--- epmain.c.orig Mon Feb 12 23:39:23 2001
+++ epmain.c Fri Apr 13 17:19:37 2001
@@ -467,6 +467,7 @@
pQueryString++ ;
nLen-- ;
break ;
+ case ';':
case '&':
pQueryString++ ;
nLen-- ;
--
Brent Ellingson
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]