Added blind untainter. Use with extreme care.

This commit is contained in:
Chris 2011-09-17 11:22:37 +01:00
parent 2c6fef0742
commit 173b029301

View File

@ -45,7 +45,7 @@ use strict;
our @ISA = qw(Exporter);
our @EXPORT = qw();
our @EXPORT_OK = qw(path_join superchomp is_defined_numeric rfc822_date title_case sentence_case get_proc_size);
our @EXPORT_OK = qw(path_join superchomp is_defined_numeric rfc822_date title_case sentence_case get_proc_size blind_untaint);
our $VERSION = 1.0;
@ -198,4 +198,19 @@ sub get_proc_size {
return $vsize || -1;
}
## @fn $ blind_untaint($str)
# Untaint the specified string blindly. This should generally only be used in
# situations where the string is guaranteed to be safe, it just needs to be
# untainted.
#
# @param str The string to untaint
# @return The untainted string
sub blind_untaint {
my $str = shift;
my ($untainted) = $str =~ /^(.*)$/;
return $untainted;
}
1;