Valerio Gionco <[EMAIL PROTECTED]> writes:

> Ok, but here is another issue...
> Suppose I wrote a TCL script that writes the value of x:

> if {[info exists ::VARS::x]} {
>     puts $::VARS::x
> }

> called with http://myserver.private/script.tcl?x=1

> A malicious user could easily crash the application calling
> http://myserver.private/script.tcl?x=1&x=2 because x becomes an
> array and puts $::VARS::x fails.

True...
 
> The best solution I've found is still the use of two variables: the
> array ::request::VARS for the variables and the list
> ::request::VARSLISTS for the variable names assigned more than a
> time (like I suggested with last email).

> Not perfect, though... nobody else has suggestions?

It's not perfect, but it is better than arbitrary seperators.

We could also use the Tcl "hash of hashes" hack, although I don't like
it much:

$VARS(x,1) == "value 1"
$VARS(x,2) == "value 1"
$VARS(x,3) == "value 1"

Maybe VARSLISTS could contain some useful information, like the length
of the list.  Actually, if we were to do that, all variables could
have one, and you would just check if it's > 1.  I kind of like that,
as > 1 is easier that [ info exists blahblah ], which gets tiring if
you use it a lot.

-- 
David N. Welton
Free Software: http://people.debian.org/~davidw/
   Apache Tcl: http://tcl.apache.org/
     Personal: http://www.efn.org/~davidw/
         Work: http://www.innominate.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to