diff options
author | gerv%gerv.net <> | 2004-03-15 08:21:00 +0100 |
---|---|---|
committer | gerv%gerv.net <> | 2004-03-15 08:21:00 +0100 |
commit | 881bbbd54a0bf3bee00eb8ab90bc8c65066f19cd (patch) | |
tree | b2db6a5cd1a68a0a6e2e0b3f4ba51241e0da089b /buglist.cgi | |
parent | 55f1c21087a26c82a81e98439cebdfacc3890c05 (diff) | |
download | bugzilla-881bbbd54a0bf3bee00eb8ab90bc8c65066f19cd.tar.gz bugzilla-881bbbd54a0bf3bee00eb8ab90bc8c65066f19cd.tar.xz |
Bug 232491 - try harder to avoid parameterless searches (either saved or otherwise.) Patch by gerv; r,a=myk.
Diffstat (limited to 'buglist.cgi')
-rwxr-xr-x | buglist.cgi | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/buglist.cgi b/buglist.cgi index d1a3c665b..0871a8c54 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -179,7 +179,11 @@ sub LookupNamedQuery { my $qname = SqlQuote($name); SendSQL("SELECT query FROM namedqueries WHERE userid = $userid AND name = $qname"); my $result = FetchOneColumn(); - $result || ThrowUserError("missing_query", {'queryname' => $name}); + + defined($result) || ThrowUserError("missing_query", {'queryname' => $name}); + $result + || ThrowUserError("buglist_parameters_required", {'queryname' => $name}); + return $result; } @@ -331,8 +335,10 @@ elsif (($::FORM{'cmdtype'} eq "doit") && $::FORM{'remtype'}) { $name !~ /[<>&]/ || ThrowUserError("illegal_query_name"); my $qname = SqlQuote($name); + $::FORM{'newquery'} || ThrowUserError("buglist_parameters_required", + {'queryname' => $name}); my $qbuffer = SqlQuote($::FORM{'newquery'}); - + my $tofooter = 1; $vars->{'message'} = "buglist_new_named_query"; |