in reply to Re: Re: Re: taint check that I thought worked
in thread taint check that I thought worked
I suspect the _ and return 1 parts are unintentional, and the function would be better as:print "failure" and return 1 if contains _ or more than 16 alphanumeri +cs otherwise return alphanumerics.
sub untaint_username { my $tainted = shift; # remove non-alphanumerics $tainted =~ y/a-zA-Z0-9//cd; # or s/[\W_]//g # must be 1-16 characters return "$1" if $tainted =~ /\A(.{1,16})\z/; print "failure\n"; return; }
|
|---|