perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brent A. Ellingson" <>
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 over to
Embperl v1.3.x, and we ran into a problem getting Embperl to accept some
query strings that 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 has accepted them. See:

However, will not only accept semicolons as form field
separators, but will also construct query strings with semicolons by
default.  This is probably incorrect behavior:

But, it's the behavior of, 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

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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message