diff --git a/includes/form.inc b/includes/form.inc
index decca00..f80175e 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -998,29 +998,29 @@ function drupal_prepare_form($form_id, &$form, &$form_state) {
   if (!isset($form['#validate'])) {
     // Ensure that modules can rely on #validate being set.
     $form['#validate'] = array();
-    // Check for a handler specific to $form_id.
-    if (function_exists($form_id . '_validate')) {
-      $form['#validate'][] = $form_id . '_validate';
-    }
-    // Otherwise check whether this is a shared form and whether there is a
-    // handler for the shared $form_id.
-    elseif (isset($form_state['build_info']['base_form_id']) && function_exists($form_state['build_info']['base_form_id'] . '_validate')) {
-      $form['#validate'][] = $form_state['build_info']['base_form_id'] . '_validate';
-    }
+  }
+  // Check for a handler specific to $form_id.
+  if (function_exists($form_id . '_validate') && !in_array($form_id . '_validate', $form['#validate'])) {
+    $form['#validate'][] = $form_id . '_validate';
+  }
+  // Otherwise check whether this is a shared form and whether there is a
+  // handler for the shared $form_id.
+  elseif (isset($form_state['build_info']['base_form_id']) && function_exists($form_state['build_info']['base_form_id'] . '_validate')) {
+    $form['#validate'][] = $form_state['build_info']['base_form_id'] . '_validate';
   }
 
   if (!isset($form['#submit'])) {
     // Ensure that modules can rely on #submit being set.
     $form['#submit'] = array();
-    // Check for a handler specific to $form_id.
-    if (function_exists($form_id . '_submit')) {
-      $form['#submit'][] = $form_id . '_submit';
-    }
-    // Otherwise check whether this is a shared form and whether there is a
-    // handler for the shared $form_id.
-    elseif (isset($form_state['build_info']['base_form_id']) && function_exists($form_state['build_info']['base_form_id'] . '_submit')) {
-      $form['#submit'][] = $form_state['build_info']['base_form_id'] . '_submit';
-    }
+  }
+  // Check for a handler specific to $form_id.
+  if (function_exists($form_id . '_submit') && !in_array($form_id . '_submit', $form['#submit'])) {
+    $form['#submit'][] = $form_id . '_submit';
+  }
+  // Otherwise check whether this is a shared form and whether there is a
+  // handler for the shared $form_id.
+  elseif (isset($form_state['build_info']['base_form_id']) && function_exists($form_state['build_info']['base_form_id'] . '_submit')) {
+    $form['#submit'][] = $form_state['build_info']['base_form_id'] . '_submit';
   }
 
   // If no #theme has been set, automatically apply theme suggestions.
