in reply to CGI question: untainting a lot of variables
It's strictly a style comment, and I apologize for that; but perhaps you might like to abbreviate the work, this way:
mkmcconnsub untaint ($$$) { my ($q,$name,$re) = @_; my $tainted = $q->param($name); my ($untainted) = $tainted =~ m/^($re)$/); badinputerror($q) unless($untainted); return $untainted; } # $untainted will be undefined if there is no match.
|
---|
In Section
Seekers of Perl Wisdom