? sites/all/modules/contrib
? sites/default/files
? sites/default/settings.php
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1244
diff -u -p -r1.1244 common.inc
--- includes/common.inc	21 Oct 2010 19:31:39 -0000	1.1244
+++ includes/common.inc	25 Oct 2010 09:29:57 -0000
@@ -5741,8 +5741,9 @@ function drupal_render_cid_create($eleme
  * Function used by uasort to sort structured arrays by weight.
  */
 function element_sort($a, $b) {
-  $a_weight = (is_array($a) && isset($a['#weight'])) ? $a['#weight'] : 0;
-  $b_weight = (is_array($b) && isset($b['#weight'])) ? $b['#weight'] : 0;
+  $a_weight = isset($a['#weight']) ? $a['#weight'] : 0;
+  $b_weight = isset($b['#weight']) ? $b['#weight'] : 0;
+
   if ($a_weight == $b_weight) {
     return 0;
   }
@@ -5784,9 +5785,9 @@ function element_info($type) {
 /**
  * Function used by uasort to sort structured arrays by weight, without the property weight prefix.
  */
-function drupal_sort_weight($a, $b) {
-  $a_weight = (is_array($a) && isset($a['weight'])) ? $a['weight'] : 0;
-  $b_weight = (is_array($b) && isset($b['weight'])) ? $b['weight'] : 0;
+function drupal_sort_weight(array $a, array $b) {
+  $a_weight = isset($a['weight']) ? $a['weight'] : 0;
+  $b_weight = isset($b['weight']) ? $b['weight'] : 0;
   if ($a_weight == $b_weight) {
     return 0;
   }
@@ -5803,8 +5804,8 @@ function element_property($key) {
 /**
  * Get properties of a structured array element. Properties begin with '#'.
  */
-function element_properties($element) {
-  return array_filter(array_keys((array) $element), 'element_property');
+function element_properties(array $element) {
+  return array_filter(array_keys($element), 'element_property');
 }
 
 /**
@@ -5834,7 +5835,7 @@ function element_children(&$elements, $s
   foreach ($elements as $key => $value) {
     if ($key === '' || $key[0] !== '#') {
       $children[$key] = $value;
-      if (is_array($value) && isset($value['#weight'])) {
+      if (isset($value['#weight'])) {
         $sortable = TRUE;
       }
     }
Index: modules/taxonomy/taxonomy.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.admin.inc,v
retrieving revision 1.114
diff -u -p -r1.114 taxonomy.admin.inc
--- modules/taxonomy/taxonomy.admin.inc	20 Oct 2010 01:31:07 -0000	1.114
+++ modules/taxonomy/taxonomy.admin.inc	25 Oct 2010 09:30:03 -0000
@@ -418,8 +418,16 @@ function taxonomy_overview_terms_submit(
     return;
   }
 
+  // Extract terms from the form.
+  $terms = array();
+  foreach ($form_state['values'] as $tid => $values) {
+    if (isset($form[$tid]['#term'])) {
+      $terms[$tid] = $values;
+    }
+  }
+
   // Sort term order based on weight.
-  uasort($form_state['values'], 'drupal_sort_weight');
+  uasort($terms, 'drupal_sort_weight');
 
   $vocabulary = $form['#vocabulary'];
   $hierarchy = 0; // Update the current hierarchy type as we go.
@@ -447,30 +455,28 @@ function taxonomy_overview_terms_submit(
 
   // Renumber the current page weights and assign any new parents.
   $level_weights = array();
-  foreach ($form_state['values'] as $tid => $values) {
-    if (isset($form[$tid]['#term'])) {
-      $term = $form[$tid]['#term'];
-      // Give terms at the root level a weight in sequence with terms on previous pages.
-      if ($values['parent'] == 0 && $term['weight'] != $weight) {
-        $term['weight'] = $weight;
-        $changed_terms[$term['tid']] = $term;
-      }
-      // Terms not at the root level can safely start from 0 because they're all on this page.
-      elseif ($values['parent'] > 0) {
-        $level_weights[$values['parent']] = isset($level_weights[$values['parent']]) ? $level_weights[$values['parent']] + 1 : 0;
-        if ($level_weights[$values['parent']] != $term['weight']) {
-          $term['weight'] = $level_weights[$values['parent']];
-          $changed_terms[$term['tid']] = $term;
-        }
-      }
-      // Update any changed parents.
-      if ($values['parent'] != $term['parent']) {
-        $term['parent'] = $values['parent'];
+  foreach ($terms as $tid => $values) {
+    $term = $form[$tid]['#term'];
+    // Give terms at the root level a weight in sequence with terms on previous pages.
+    if ($values['parent'] == 0 && $term['weight'] != $weight) {
+      $term['weight'] = $weight;
+      $changed_terms[$term['tid']] = $term;
+    }
+    // Terms not at the root level can safely start from 0 because they're all on this page.
+    elseif ($values['parent'] > 0) {
+      $level_weights[$values['parent']] = isset($level_weights[$values['parent']]) ? $level_weights[$values['parent']] + 1 : 0;
+      if ($level_weights[$values['parent']] != $term['weight']) {
+        $term['weight'] = $level_weights[$values['parent']];
         $changed_terms[$term['tid']] = $term;
       }
-      $hierarchy = $term['parent'] != 0 ? 1 : $hierarchy;
-      $weight++;
     }
+    // Update any changed parents.
+    if ($values['parent'] != $term['parent']) {
+      $term['parent'] = $values['parent'];
+      $changed_terms[$term['tid']] = $term;
+    }
+    $hierarchy = $term['parent'] != 0 ? 1 : $hierarchy;
+    $weight++;
   }
 
   // Build a list of all terms that need to be updated on following pages.
