Commit e4bb080d authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 234226: "Find a specific bug" shouldn't allow empty search - Patch by…

Bug 234226: "Find a specific bug" shouldn't allow empty search - Patch by Fré©ric Buclin <LpSolit@gmail.com> r/a=justdave
parent 41732933
...@@ -74,6 +74,12 @@ if (defined($searchstring)) { ...@@ -74,6 +74,12 @@ if (defined($searchstring)) {
# as if this had been a normal query from the beginning. # 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 # Data and Security Validation
################################################################################ ################################################################################
......
...@@ -109,8 +109,12 @@ for "crash secure SSL flash". ...@@ -109,8 +109,12 @@ for "crash secure SSL flash".
<tr> <tr>
<td></td> <td></td>
<td> <td>
<input type="submit" id="search" value="Search"> <input type="submit" id="search" value="Search"
</td> 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> </tr>
</table> </table>
</form> </form>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment