summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Util.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Util.pm')
-rw-r--r--Bugzilla/Util.pm9
1 files changed, 3 insertions, 6 deletions
diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm
index 513e02857..21588417c 100644
--- a/Bugzilla/Util.pm
+++ b/Bugzilla/Util.pm
@@ -68,17 +68,14 @@ sub trick_taint {
sub detaint_natural {
my $match = $_[0] =~ /^(\d+)$/;
- $_[0] = $match ? $1 : undef;
+ $_[0] = $match ? int($1) : undef;
return (defined($_[0]));
}
sub detaint_signed {
my $match = $_[0] =~ /^([-+]?\d+)$/;
- $_[0] = $match ? $1 : undef;
- # Remove any leading plus sign.
- if (defined($_[0]) && $_[0] =~ /^\+(\d+)$/) {
- $_[0] = $1;
- }
+ # The "int()" call removes any leading plus sign.
+ $_[0] = $match ? int($1) : undef;
return (defined($_[0]));
}