From 881bbbd54a0bf3bee00eb8ab90bc8c65066f19cd Mon Sep 17 00:00:00 2001 From: "gerv%gerv.net" <> Date: Mon, 15 Mar 2004 07:21:00 +0000 Subject: Bug 232491 - try harder to avoid parameterless searches (either saved or otherwise.) Patch by gerv; r,a=myk. --- buglist.cgi | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'buglist.cgi') 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"; -- cgit v1.2.3-24-g4f1b