From: lpsolit%gmail.com <> Date: Fri, 17 Jun 2005 02:04:25 +0000 (+0000) Subject: Bug 297928: detaint_natural, detaint_signed and trick_taint shouldn't rely on $1... X-Git-Tag: bugzilla-2.18.2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a10b3ff33fa2ef9c6fb7fc67d4a742f7973aa59;p=thirdparty%2Fbugzilla.git Bug 297928: detaint_natural, detaint_signed and trick_taint shouldn't rely on $1 - Patch by Christian Reis r/a = justdave --- diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm index 926b92fcee..bbc13b3ffa 100644 --- a/Bugzilla/Util.pm +++ b/Bugzilla/Util.pm @@ -50,20 +50,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;