[REBOL] Re: possible load bug ?
From: laurent:giroud:libertysurf at: 10-Aug-2002 21:20
> I don't know why your code isn't woking, though it seems to be choking on the
> script command. But 'Load is not a good way to capture untrusted strings.
> Try these for example:
>
> test: load " rebol [quit] "
> ;; will execute the line and exit the console
>
> test: load/all " rebol [quit] "
> ;; doesn't have that problem, but
>
> test: load/all "bad . * ^ & ("
> ;; fails as load needs to find something that makes a valid rebol block, with
> valid rebol words.
>
> Even if you trust the string. Load & load/all will eat up system/words space.
> to-block is an alternative.
>
> But much safer is:
>
> test: read http://www.google.fr
> write %test.html test
> or
> test: read/lines http://www.google.fr
> write/lines %test.html test
Thanks for the explanation !
So this is effectively a rookie error ;)
the code :
test: load/markup URL
doesn't exhibit the problem which confirms that the problem arises because of
load trying to interpret the html page.
This leads me to ask why /markup is implemented as a 'load refinement ?
Wouldn't it be better placed within 'read ?
Regards,
Laurent
--
Laurent Giroud