Lines 280-286
Link Here
|
280 |
sub untaint_var { |
280 |
sub untaint_var { |
281 |
# my $arg = $_[0]; # avoid copying unnecessarily |
281 |
# my $arg = $_[0]; # avoid copying unnecessarily |
282 |
if (!ref $_[0]) { # optimized by-far-the-most-common case |
282 |
if (!ref $_[0]) { # optimized by-far-the-most-common case |
283 |
return defined $_[0] ? scalar each %{ { $_[0] => undef } } : undef; ## no critic (ProhibitExplicitReturnUndef) - See Bug 7120 - fast untaint (hash keys cannot be tainted) |
283 |
#return defined $_[0] ? scalar each %{ { $_[0] => undef } } : undef; ## no critic (ProhibitExplicitReturnUndef) - See Bug 7120 - fast untaint (hash keys cannot be tainted) |
|
|
284 |
no re 'taint'; # override a "use re 'taint'" from outer scope |
285 |
return undef if !defined $_[0]; ## no critic (ProhibitExplicitReturnUndef) - See Bug 7120 |
286 |
local($1); # avoid Perl taint bug: tainted global $1 propagates taintedness |
287 |
$_[0] =~ /^(.*)\z/s; |
288 |
return $1; |
289 |
|
284 |
} else { |
290 |
} else { |
285 |
my $r = ref $_[0]; |
291 |
my $r = ref $_[0]; |
286 |
if ($r eq 'ARRAY') { |
292 |
if ($r eq 'ARRAY') { |