in reply to CGI question: untainting a lot of variables
--
perl -pe "s/\b;([st])/'\1/mg"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: CGI question: untainting a lot of variables
by jlongino (Parson) on Dec 31, 2001 at 09:14 UTC | |
I looked into CGI::Untaint but was non-plused by the documentation. Untainting CGI data, if I understand the basic concept, is not a complicated task. In fact, I had assumed that there wasn't an Untaint module (apparently incorrectly) for that very reason. The CGI::Untaint module, OTOH, seems aimed more towards data validation (via Extract) where untainting the data is just a pass through step. If all I wanted to do was untaint my CGI params, how would just that one task be accomplished using CGI::Untaint? The documentation is rather vague on that point. The module also appears to be fairly young. Is this a situation where roll-your-own is an acceptable option? On a more general note, are there any hard and fast rules for evaluating the suitability of a module for a given task other than by recommendation (assuming we're talking about a beginner at Perl). Specifically, how can you tell if a more recent module has been adequately vetted? As an aside, this module doesn't appear to be available directly from Active State via ppm. --Jim | [reply] |
by BMaximus (Chaplain) on Dec 31, 2001 at 10:52 UTC | |
An example of input_profiles.pl taken from the documentation The data in $valid is now considered untainted and all unexpected fields are put in $unknown as an array ref. Read the documentation on Data::FormValidator as this module will not only allow you to set the rules of the data coming in but also weed out the data that you don't want. BMaximus | [reply] [d/l] [select] |