in reply to First Time Untainting Data
But, getting to your taint issue, there's also no place in having a generic "untaint" subroutine. The act of untainting is always specific to the narrowest definition of what is permitted in the data. You don't have just "untaint", you have "untaint_username" or "untaint_hostname". And "untaint_email_address" cannot exist, because every possible character is possible in an email address. {grin}
Also, "tainting" is generally associated with programs running in "taint" mode, which I'm not seeing in your snippet. And when that happens, you need to execute a specific form of match to get rid of the taint. Something like:
$data = /^([a-z]+)$/ or die "data isn't just alphabetic!"; $data = $1; # now grab the untainted version
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Flock and Destroy
by svsingh (Priest) on Oct 10, 2003 at 20:47 UTC | |
by merlyn (Sage) on Oct 11, 2003 at 15:23 UTC | |
by zigdon (Deacon) on Oct 13, 2003 at 15:21 UTC |