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 | |
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.
-rwxr-xr-x | buglist.cgi | 10 | ||||
-rw-r--r-- | template/en/default/global/user-error.html.tmpl | 4 |
2 files changed, 9 insertions, 5 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"; diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index 3fa735cc3..1577619ee 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -118,9 +118,7 @@ [% ELSIF error == "buglist_parameters_required" %] [% title = "Parameters Required" %] - [% url = "query.cgi" %] - [% link = "Please use the search form to specify some search criteria." %] - This script is not meant to be invoked without any search terms. + You may not search, or create saved searches, without any search terms. [% ELSIF error == "bugs_not_changed" %] [% title = BLOCK %][% terms.Bugs %] Not Changed[% END %] |