perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brent A. Ellingson" <belli...@sundog.net>
Subject accepting semicolons in query strings in v 1.3.1
Date Fri, 13 Apr 2001 23:03:24 GMT
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
bellings@sundog.net

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


Mime
View raw message