CGI::U...object(3pm)
π NAME π
CGI::Untaint::object β the base class for Input Handlers, bestie. It's the blueprint, the blueprint-iest blueprint π
β¨ SYNOPSIS β¨
package MyUntaint::foo;
use base 'CGI::Untaint::object';
sub _untaint_re {
return qr/$your_regex/;
}
sub is_valid {
my $self = shift;
return is_ok($self->value);
}
1;
π¦ DESCRIPTION π¦
okay so this is the base class that literally every Untaint object should inherit from. Like, all of them. It's giving matriarch. It's giving "everyone in this house came from me" π
π METHODS TO SUBCLASS π
πΈ is_valid / _untaint_re
Your subclass needs to do one of two things, and honestly pick your fighter:
- hand over a regular expression inside
_untaint_reβ and yes, the author fully admits he should really make this public π - or just write an entire
is_validmethod yourself, main character energy, no notes
π METHODS TO CALL π
β value
ngl, this should really have been two methods. It's two jobs in one trenchcoat. But way too many other modules now depend on the fact that this one does double duty, so here we are, locked in forever π
- as an accessor, this is the
'raw'value - as a mutator, it's the extracted one
π re_all / re_none
These are regular expressions that match anything, or nothing, untained. That's the whole vibe.
β οΈ Only use these if you have already validated your entry in some way that means you completely trust the data. Like, completely. No cap. If you haven't, don't.
π§ untainted
Are we clean yet? π«§ That's it. That's the method. It's the vibe check for your data.
perl v5.34.0 πΈ 2022-06-10 β mwah, that's the version and the date this lil page was born, and honestly? iconic. go forth and untaint responsibly, bestie πβ¨
π¦ where this page comes from
- debian bookworm: libcgi-untaint-perl 1.26-8 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcgi-untaint-perl 1.26-8 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcgi-untaint-perl 1.26-8 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcgi-untaint-perl 1.26-8 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcgi-untaint-perl 1.26-8 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms