summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-08-26 07:31:48 +0000
committerDries Buytaert <dries@buytaert.net>2007-08-26 07:31:48 +0000
commita8800e4f2694a0107bbf425212bdccb1fe81f5cb (patch)
treee7e3d69e086f9a03c94cb3dcbbb47a1d0d061749
parent31c357f9c8e4ffe9f635189fa1315495bc427752 (diff)
downloadbrdo-a8800e4f2694a0107bbf425212bdccb1fe81f5cb.tar.gz
brdo-a8800e4f2694a0107bbf425212bdccb1fe81f5cb.tar.bz2
- Patch #146667 by coofercat: fixed bug in form builder.
-rw-r--r--includes/form.inc10
1 files changed, 6 insertions, 4 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 0bbc04867..7be8fb061 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -69,11 +69,13 @@ function drupal_get_form($form_id) {
// to build it from scratch.
if (!isset($form)) {
$form_state['post'] = $_POST;
- array_shift($args);
- array_unshift($args, $form_state);
- array_unshift($args, $form_id);
+ // Use a copy of the function's arguments for manipulation
+ $args_temp = $args;
+ array_shift($args_temp);
+ array_unshift($args_temp, $form_state);
+ array_unshift($args_temp, $form_id);
- $form = call_user_func_array('drupal_retrieve_form', $args);
+ $form = call_user_func_array('drupal_retrieve_form', $args_temp);
$form_build_id = 'form-'. md5(mt_rand());
$form['#build_id'] = $form_build_id;
drupal_prepare_form($form_id, $form, $form_state);