Index: modules/search/search.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.module,v
retrieving revision 1.355
diff -u -r1.355 search.module
--- modules/search/search.module	10 Aug 2010 01:11:36 -0000	1.355
+++ modules/search/search.module	10 Aug 2010 19:32:39 -0000
@@ -1008,6 +1008,16 @@
     unset($_GET['destination']);
   }
 
+  // Check to see if the form was submitted empty.
+  // If it is empty, display an error message.
+  // (This method is used instead of setting #required to TRUE for this field
+  // because that results in a confusing error message.  It would say a plain
+  // "field is required" because the search keywords field has no title.
+  // The error message would also complain about a missing #title field.)
+  if ($form_state['values']['search_block_form'] == '') {
+    form_set_error('keys', t('Please enter some keywords.'));
+  }
+
   $form_id = $form['form_id']['#value'];
   $info = search_get_default_module_info();
   if ($info) {
Index: modules/search/search.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.test,v
retrieving revision 1.69
diff -u -r1.69 search.test
--- modules/search/search.test	10 Aug 2010 01:11:36 -0000	1.69
+++ modules/search/search.test	10 Aug 2010 19:32:39 -0000
@@ -590,6 +590,25 @@
     $this->drupalPost('admin/structure/block/manage/search/form/configure', $edit, t('Save block'));
     $this->drupalPost('node', $terms, t('Search'));
     $this->assertText('Your search yielded no results');
+
+    // Confirm that the user is redirected to the search page.
+    $this->assertEqual(
+      $this->getUrl(),
+      url('search/node/' . $terms['search_block_form'], array('absolute' => TRUE)),
+      t('Redirected to correct url.')
+    );
+
+    // Test an empty search via the block form, from the front page.
+    $terms = array('search_block_form' => '');
+    $this->drupalPost('node', $terms, t('Search'));
+    $this->assertText('Please enter some keywords');
+
+    // Confirm that the user is redirected to the search page, when form is submitted empty.
+    $this->assertEqual(
+      $this->getUrl(),
+      url('search/node/', array('absolute' => TRUE)),
+      t('Redirected to correct url.')
+    );
   }
 }
 
