in reply to Taint mode
WWW::Taint.pm # # Utility routines for untainting strings. All three will accept # a single scalar as argument, and return the same scalar back # or undef if it flunks. It's possible to call untaint() directly # and supply your own regexp, but probably better to extend the # package with your own method if you really need it. # # the empty string returns an empty string (meaningless but untainted # hence defined). Undef returns undef. # # the three flavors are slut(), easy() and saint(). # # slut() always returns what you passed it. a string like # "myfilename; cd /; rm -rf *" is totally cool. Needless to say, # this should be used with extreme caution. Trusted files (like # configuration files) and really ugly data (i.e. the comment lines # in database references). # # easy() allows most chars but excludes things known to be hazardous to # the shell, i.e. non-displayable chars, '&', ';' '`', '|' '>', '<' # # saint() allows only alphanumerics and '_', '-', '.', ':' and '/'. # It's intended mostly for (unix) file paths.
|
|---|