diff --git a/core/modules/search/search.module b/core/modules/search/search.module
index 315ae7a..05e1462 100644
--- a/core/modules/search/search.module
+++ b/core/modules/search/search.module
@@ -1030,12 +1030,29 @@ function search_box($form, &$form_state, $form_id) {
   );
   $form['actions'] = array('#type' => 'actions');
   $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Search'));
+  $form['#validate'][] = 'search_box_form_validate';
   $form['#submit'][] = 'search_box_form_submit';
 
   return $form;
 }
 
 /**
+ * Validates a block search form submission
+ *
+ * @see search_box_form_submit()
+ */
+function search_box_form_validate($form, &$form_state) {
+  $form_id = $form['form_id']['#value'];
+  $info = search_get_default_module_info();
+  if ($info) {
+    $form_state['redirect'] = 'search/' . $info['path'] . '/' . trim($form_state['values'][$form_id]);
+  }
+  else {
+    form_set_error(NULL, t('Search is currently disabled.'), 'error');
+  }
+}
+
+/**
  * Process a block search form submission.
  */
 function search_box_form_submit($form, &$form_state) {
@@ -1055,15 +1072,6 @@ function search_box_form_submit($form, &$form_state) {
   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) {
-    $form_state['redirect'] = 'search/' . $info['path'] . '/' . trim($form_state['values'][$form_id]);
-  }
-  else {
-    form_set_error(NULL, t('Search is currently disabled.'), 'error');
-  }
 }
 
 /**
