From: David Lawrence Date: Thu, 18 Sep 2014 17:03:55 +0000 (+0000) Subject: Bug 829273: Certain webservice tests failing due to improper error being thrown for... X-Git-Tag: bugzilla-4.5.6~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=917ede930a27180b6e6adeb16a46efc8156d36cc;p=thirdparty%2Fbugzilla.git Bug 829273: Certain webservice tests failing due to improper error being thrown for undef or empty bug id values r=glob,a=glob --- diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 3aba1774ac..a92a7077bd 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -312,8 +312,8 @@ sub new { # If we get something that looks like a word (not a number), # make it the "name" param. if (!defined $param - || (!ref($param) && $param =~ /\D/) - || (ref($param) && $param->{id} =~ /\D/)) + || (!ref($param) && $param !~ /^\d+$/) + || (ref($param) && $param->{id} !~ /^\d+$/)) { if ($param) { my $alias = ref($param) ? $param->{id} : $param;