Index: modules/search/search.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.module,v
retrieving revision 1.319
diff -u -p -r1.319 search.module
--- modules/search/search.module	9 Oct 2009 01:00:02 -0000	1.319
+++ modules/search/search.module	9 Oct 2009 20:53:52 -0000
@@ -845,7 +845,7 @@ function search_get_keys() {
  * Render a search form.
  *
  * @param $action
- *   Form action. Defaults to "search".
+ *   Form action. Defaults to "search/$type". This will be run through url().
  * @param $keys
  *   The search string entered by the user, containing keywords for the search.
  * @param $type
@@ -861,13 +861,15 @@ function search_form($form, &$form_state
   drupal_add_css(drupal_get_path('module', 'search') . '/search.css', array('preprocess' => FALSE));
 
   if (!$action) {
-    $action = url('search/' . $type);
+    $action = 'search/' . $type;
   }
   if (is_null($prompt)) {
     $prompt = t('Enter your keywords');
   }
 
-  $form['#action'] = $action;
+  $form['#action'] = url($action);
+  // Record the $action for later use in redirecting.
+  $form_state['action'] = $action;
   $form['#attributes']['class'][] = 'search-form';
   $form['module'] = array('#type' => 'value', '#value' => $type);
   $form['basic'] = array('#type' => 'item', '#title' => $prompt, '#id' => 'edit-keys');
Index: modules/search/search.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.pages.inc,v
retrieving revision 1.12
diff -u -p -r1.12 search.pages.inc
--- modules/search/search.pages.inc	9 Oct 2009 01:00:03 -0000	1.12
+++ modules/search/search.pages.inc	9 Oct 2009 20:53:52 -0000
@@ -138,6 +138,6 @@ function search_form_submit($form, &$for
   }
 
   $type = $form_state['values']['module'] ? $form_state['values']['module'] : 'node';
-  $form_state['redirect'] = 'search/' . $type . '/' . $keys;
+  $form_state['redirect'] = $form_state['action'] . '/' . $keys;
   return;
 }
