summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbuglist.cgi6
-rw-r--r--template/en/default/search/search-specific.html.tmpl8
2 files changed, 12 insertions, 2 deletions
diff --git a/buglist.cgi b/buglist.cgi
index 948916d0f..96011d3f7 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -74,6 +74,12 @@ if (defined($searchstring)) {
# as if this had been a normal query from the beginning.
}
+# Reject empty searches from the simple search form, including
+# words being a single or several consecutive whitespaces only.
+if (defined($cgi->param('content')) && $cgi->param('content') =~ /^\s*$/) {
+ ThrowUserError("buglist_parameters_required");
+}
+
################################################################################
# Data and Security Validation
################################################################################
diff --git a/template/en/default/search/search-specific.html.tmpl b/template/en/default/search/search-specific.html.tmpl
index 2d7eb945d..d93abd883 100644
--- a/template/en/default/search/search-specific.html.tmpl
+++ b/template/en/default/search/search-specific.html.tmpl
@@ -109,8 +109,12 @@ for "crash secure SSL flash".
<tr>
<td></td>
<td>
- <input type="submit" id="search" value="Search">
- </td>
+ <input type="submit" id="search" value="Search"
+ onclick="if (this.form.content.value == '')
+ {alert('The Words field cannot be empty. You have to ' +
+ 'enter at least one word in your search criteria.');
+ return false;} return true;">
+ </td>
</tr>
</table>
</form>