[REBOL] Re: decode-cgi bug (?)

2004-02-19 Thread Andreas Bolka
Thursday, February 19, 2004, 5:18:19 PM, Will wrote: > there seems to be a bug in your function: >>> decode-cgi "a=1&b=&c=3" > == [a: "1" b: "1" c: "3"] thanks for reporting, will. fixed: decode-cgi: func [ {Converts CGI argument string to a list of words and value strings.} args [

[REBOL] Re: decode-cgi bug (?)

2004-02-19 Thread Will Arp
Hi Andres, there seems to be a bug in your function: >> decode-cgi "a=1&b=&c=3" == [a: "1" b: "1" c: "3"] Will On 10-feb-04, at 00:50, Andreas Bolka wrote: > -- snip -- > decode-cgi: func [ > {Converts CGI argument string to a list of words and value > strings.} > args [any-string!

[REBOL] Re: decode-cgi bug (?)

2004-02-10 Thread iNetW3
Hi Hallvard, Would this help any? you can replace the " replace/all "this" "this" " with a "foreach char_block" and "parse cgi (replace cgi "this" "this") -- cgi: "state=thread%20s&board=cult.tamaraswift&

[REBOL] Re: decode-cgi bug (imbedded spaces in names)

2004-02-10 Thread Tom Conlin
Hi Tim, by my count it is in the sixth post of this thread. the basic idea is to brighten up decode-cgi so it can return a block of set words instead of a block of string pairs. which can be coerced into an honest to goodness OBJECT So CGI processing would seem more similar to the way some othe

[REBOL] Re: decode-cgi bug (imbedded spaces in names)

2004-02-10 Thread Tim Johnson
* Andreas Bolka <[EMAIL PROTECTED]> [040210 06:04]: > > > Tuesday, February 10, 2004, 12:47:11 AM, Tim wrote: > > > 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 i

[REBOL] Re: decode-cgi bug (imbedded spaces in names)

2004-02-10 Thread Tim Johnson
* Tom Conlin <[EMAIL PROTECTED]> [040209 17:04]: > > > > that is exactly the sort of thing 'vet-word avoids. Tom: Tell me more about 'vet-word, if you can. thanks tim > it is obviously a work in progress and of all the unsatisfaftory > side effects I think the least unsati

[REBOL] Re: decode-cgi bug (imbedded spaces in names)

2004-02-10 Thread Andreas Bolka
Tuesday, February 10, 2004, 12:47:11 AM, Tim wrote: > 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 name

[REBOL] Re: decode-cgi bug (imbedded spaces in names)

2004-02-09 Thread Tom Conlin
that is exactly the sort of thing 'vet-word avoids. it is obviously a work in progress and of all the unsatisfaftory side effects I think the least unsatisfaftory is yet to be found. On Mon, 9 Feb 2004, Tim Johnson wrote: > > * Hallvard Ystad <[EMAIL PROTECTED]> [040209 13:31]: > It looks l

[REBOL] Re: decode-cgi bug (?)

2004-02-09 Thread Andreas Bolka
Monday, February 9, 2004, 11:07:27 PM, Hallvard wrote: > 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&&

[REBOL] Re: decode-cgi bug (imbedded spaces in names)

2004-02-09 Thread Tim Johnson
* Hallvard Ystad <[EMAIL PROTECTED]> [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 progra

[REBOL] Re: decode-cgi bug (?)

2004-02-09 Thread Hallvard Ystad
Brilliant. Thanks! But: >> decode-cgi >> {url=http%3A//www.bbc.co.uk/cgi-perl/h2/h2.cgi%3Fstate%3Dthreads%26board%3Dcult.tamaraswift%26%26sort%3DT} == [url: "http://www.bbc.co.uk/cgi-perl/h2/h2.cgi?state";] >> Phew. This time I _really_really_ am off to bed. HY Dixit Tom Conlin (00.24 10.02.2

[REBOL] Re: decode-cgi bug (?)

2004-02-09 Thread Tom Conlin
ok here is a version that allows multiple &'s decode-cgi: func [args [any-string!] /raw /local cgi-block name value mark here ][ all[empty? args return ""] structural: make bitset! "+&=%" non-struct: complement structural xchar: make bitset! {0123456789ABCDEFabcdef} safe-xchar: make bitset

[REBOL] Re: decode-cgi bug (?)

2004-02-09 Thread Hallvard Ystad
Sorry, Tom, your script fails to get the 'sort parameter too. This time I'm _really_ off to bed. HY Dixit Tom Conlin (00.02 10.02.2004): >howdy, > >I was fiddling with this recently hoping to get an improved version into >view 1.3. there are different thoughts on 'decode-cgi should be a >high

[REBOL] Re: decode-cgi bug (?)

2004-02-09 Thread Tom Conlin
howdy, I was fiddling with this recently hoping to get an improved version into view 1.3. there are different thoughts on 'decode-cgi should be a higher/lower level function my belief is it should be pretty dumb and just break strings up on a structural basis. but that leads to newby biting whic

[REBOL] Re: decode-cgi bug (?)

2004-02-09 Thread Hallvard Ystad
Oh, I tried with the source from /view 1.2.10, but got the same result. Could you perhaps send me the code? Getting the parameter with the ampersand is better than nothing, after all... Thanks, HY Dixit [EMAIL PROTECTED] (23.32 09.02.2004): >Hallvard: > >> I believe Andreas Bolka and/or Andre

[REBOL] Re: decode-cgi bug (?)

2004-02-09 Thread Hallvard Ystad
Thanks, Will, but no, this doesn't fix the problem. The URL I found had two adjacent &s: state=threads&board=cult.tamaraswift&&sort=T I think whoever made this URL ment for sort=T to join in, but your code doesn't let it. I only get state and board. Any ideas? (I'll look into it more closely m

[REBOL] Re: decode-cgi bug (?)

2004-02-09 Thread Will Arp
Hi Hallvard; this one work on your url, it also has some enhancement most preferred is ability to set a: "" when http://dom.com?a I'm not sure who is the author but thanks, and shouldn't this version replace rebol's one? Hope that helps and have a great day! Will Arp [EMAIL PROTECTED] ;core

[REBOL] Re: decode-cgi bug (?)

2004-02-09 Thread SunandaDH
Hallvard: > 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? decode-cgi works under View (at least where I am). (Core fails here, just