зеркало из https://github.com/mozilla/pjs.git
Bug 297928: detaint_natural, detaint_signed and trick_taint shouldn't rely on $1 - Patch by Christian Reis <kiko@async.com.br> r/a = justdave
This commit is contained in:
Родитель
7f0479a0b2
Коммит
8f949e1a38
|
@ -59,20 +59,20 @@ sub is_tainted {
|
|||
sub trick_taint {
|
||||
require Carp;
|
||||
Carp::confess("Undef to trick_taint") unless defined $_[0];
|
||||
$_[0] =~ /^(.*)$/s;
|
||||
$_[0] = $1;
|
||||
my ($match) = $_[0] =~ /^(.*)$/s;
|
||||
$_[0] = $match;
|
||||
return (defined($_[0]));
|
||||
}
|
||||
|
||||
sub detaint_natural {
|
||||
$_[0] =~ /^(\d+)$/;
|
||||
$_[0] = $1;
|
||||
my ($match) = $_[0] =~ /^(\d+)$/;
|
||||
$_[0] = $match;
|
||||
return (defined($_[0]));
|
||||
}
|
||||
|
||||
sub detaint_signed {
|
||||
$_[0] =~ /^([-+]?\d+)$/;
|
||||
$_[0] = $1;
|
||||
my ($match) = $_[0] =~ /^([-+]?\d+)$/;
|
||||
$_[0] = $match;
|
||||
# Remove any leading plus sign.
|
||||
if (defined($_[0]) && $_[0] =~ /^\+(\d+)$/) {
|
||||
$_[0] = $1;
|
||||
|
|
Загрузка…
Ссылка в новой задаче