[REBOL] Re: decode-cgi bug (imbedded spaces in names)
From: tim::johnsons-web::com at: 9-Feb-2004 14:47
* Hallvard Ystad <[hallvard--ystad--oops-as--no]> [040209 13:31]:
It looks like Hallvard's problem is being addressed, but I want to
note that I modified decode-cgi so that a block of string pairs
is returned rather than a block of alternating to-set-word types
and strings.
Reason for it:
A rebol cgi program might be processing a form in which field
names have imbedded spaces. This isn't a practice of mine,
and I avoid it on any of our projects, but the eventuality
would yield unpredicatable results:
example:
>> res: context decode-cgi "field one=1&fieldtwo=2"
>> probe res
make object! [
field one: "1"
fieldtwo: "2"
]
>> res/fieldtwo
== "2"
>>res/field one
** Script Error: Invalid path value: field
** Near: res/field one
tim
> Hi
>
> I know some people say "garbage in - garbage out", but one can't always control what
comes into one's programs as input. Here's what came to one of mine:
>
> http://www.bbc.co.uk/cgi-perl/h2/h2.cgi?state=threads&board=cult.tamaraswift&&sort=T
>
> This crashes 'decode-cgi in /core 2.5.6:
> >> decode-cgi "state=threads&board=cult.tamaraswift&&sort=T"
> ** Script Error: Out of range or past end
> ** Where: to-set-word
> ** Near: to set-word! :value
> >>
>
> I believe Andreas Bolka and/or Andrew Martin made a patch to 'decode-cgi some time
back, but can't seem to find it. Does anyone know whether the patch fixes this problem?
Or perhaps where I can find it?
>
> Thanks,
> HY
>
> Pr=E6tera censeo Carthaginem esse delendam
>
> --
> To unsubscribe from this list, just send an email to
> [rebol-request--rebol--com] with unsubscribe as the subject.
--
Tim Johnson <[tim--johnsons-web--com]>
http://www.alaska-internet-solutions.com