diff options
author | lpsolit%gmail.com <> | 2005-06-17 04:00:58 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2005-06-17 04:00:58 +0200 |
commit | de027530e15fc988f94411784abf368971ff8155 (patch) | |
tree | 5de85158bcedc526f9753c5b8e5473c9d2c83dfe | |
parent | 1fde21205d29e4fb435649ff7e8323af7d4cd1de (diff) | |
download | bugzilla-de027530e15fc988f94411784abf368971ff8155.tar.gz bugzilla-de027530e15fc988f94411784abf368971ff8155.tar.xz |
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
-rw-r--r-- | Bugzilla/Util.pm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm index 4dc64fe94..91e66f9f8 100644 --- a/Bugzilla/Util.pm +++ b/Bugzilla/Util.pm @@ -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; |