| View previous topic :: View next topic |
| Author |
Message |
honeybee Halfop
Joined: 01 Jan 2006 Posts: 80
|
Posted: Thu Jun 29, 2006 1:45 pm Post subject: Spliting arguments |
|
|
I'm using a public command tcl, though i have splited the argument
| Quote: | | example: [lrange [split $arg] 1 end] |
but still if someone use reason with special chars like [ or \ the reason appeared to be | Quote: | | like: {[/z]} {}) or {[whatever reason with brackets]}) | , which is surely a security whole.
[/quote] |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Thu Jun 29, 2006 1:48 pm Post subject: |
|
|
Security wholes you only make yourself. If properly used it doesnt matter which bytes they use. Split is doing its job well... if needed. The thing you probably wanted to do is:
[join [lrange [split $arg] 1 end]]
or equivalent one:
[join [lreplace [split $arg] 0 0]]
or without any list functions:
[string range $arg [expr {[string first " " $arg] + 1}] end] _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
|