? sites/default/files
? sites/default/settings.php
Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.308
diff -u -p -r1.308 form.inc
--- includes/form.inc	3 Dec 2008 16:32:21 -0000	1.308
+++ includes/form.inc	19 Dec 2008 08:57:44 -0000
@@ -1386,7 +1386,12 @@ function form_options_flatten($array, $r
       form_options_flatten($value->option, FALSE);
     }
     elseif (is_array($value)) {
-      form_options_flatten($value, FALSE);
+      if (isset($value['#value']) && isset($value['#return_value'])) {
+        $return[$value['#return_value']] = 1;
+      }
+      else {
+        form_options_flatten($value, FALSE);
+      }
     }
     else {
       $return[$key] = 1;
@@ -1429,23 +1434,40 @@ function form_select_options($element, $
   $value_is_array = is_array($element['#value']);
   $options = '';
   foreach ($choices as $key => $choice) {
-    if (is_array($choice)) {
-      $options .= '<optgroup label="' . $key . '">';
-      $options .= form_select_options($element, $choice);
-      $options .= '</optgroup>';
+    if (is_object($choice)) {
+      $optioncontent = each($choice->option);
+      $choice = array(
+        '#value' => $optioncontent['value'],
+	'#return_value' => $optioncontent['key'],
+      );
     }
-    elseif (is_object($choice)) {
-      $options .= form_select_options($element, $choice->option);
+    if (!is_array($choice)) {
+      $choice = array('#value' => $choice);
+    }
+    elseif (!isset($choice['#value']) && !isset($choice['#options'])) {
+      $choice = array('#value' => array_shift($choice));
+    }
+    elseif (!isset($choice['#value']) && isset($choice['#options'])) {
+      $choice['#value'] = (string)$key;
+    }
+    if (!isset($choice['#return_value'])) {
+      $choice['#return_value'] = (string)$key;
+    }
+
+    if (isset($choice['#options']) && is_array($choice['#options'])) {
+      $options .= '<optgroup label="' . $choice['#value'] . '">';
+      $options .= form_select_options($element, $choice['#options']);
+      $options .= '</optgroup>';
     }
     else {
-      $key = (string)$key;
-      if ($value_valid && (!$value_is_array && (string)$element['#value'] === $key || ($value_is_array && in_array($key, $element['#value'])))) {
+      if ($value_valid && (!$value_is_array && (string)$element['#value'] === $choice['#return_value'] 
+          || ($value_is_array && in_array($choice['#return_value'], $element['#value'])))) {
         $selected = ' selected="selected"';
       }
       else {
         $selected = '';
       }
-      $options .= '<option value="' . check_plain($key) . '"' . $selected . '>' . check_plain($choice) . '</option>';
+      $options .= '<option value="' . check_plain($choice['#return_value']) . '"' . $selected . '>' . check_plain($choice['#value']) . '</option>';
     }
   }
   return $options;
Index: modules/trigger/trigger.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/trigger/trigger.admin.inc,v
retrieving revision 1.7
diff -u -p -r1.7 trigger.admin.inc
--- modules/trigger/trigger.admin.inc	16 Jul 2008 21:59:28 -0000	1.7
+++ modules/trigger/trigger.admin.inc	19 Dec 2008 08:57:44 -0000
@@ -135,7 +135,10 @@ function trigger_assign_form($form_state
   }
   foreach (actions_actions_map(actions_get_all_actions()) as $aid => $action) {
     if (in_array($action['callback'], $functions)) {
-      $options[$action['type']][$aid] = $action['description'];
+      $options[$action['type']]['#options'][] = array(
+        '#value' => $action['description'],
+	'#return_value' => $aid,
+      );
     }
   }
 
Index: modules/user/user.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.admin.inc,v
retrieving revision 1.33
diff -u -p -r1.33 user.admin.inc
--- modules/user/user.admin.inc	16 Nov 2008 15:10:49 -0000	1.33
+++ modules/user/user.admin.inc	19 Dec 2008 08:57:44 -0000
@@ -46,7 +46,13 @@ function user_filter_form() {
   foreach ($session as $filter) {
     list($type, $value) = $filter;
     // Merge an array of arrays into one if necessary.
-    $options = $type == 'permission' ? call_user_func_array('array_merge', $filters[$type]['options']) : $filters[$type]['options'];
+    $options = $filter[$type]['options'];
+    if ($type == 'permission') {
+      $options = array();
+      foreach ($filter[$type]['options'] as $filtermodule) {
+        $options += $filtermodule['#options'];
+      }
+    }
     $params = array('%property' => $filters[$type]['title'] , '%value' => $options[$value]);
     if ($i++ > 0) {
       $form['filters']['current'][] = array('#markup' => t('<em>and</em> where <strong>%property</strong> is <strong>%value</strong>', $params));
@@ -99,7 +105,13 @@ function user_filter_form_submit($form, 
       if (isset($form_state['values']['filter'])) {
         $filter = $form_state['values']['filter'];
         // Merge an array of arrays into one if necessary.
-        $options = $filter == 'permission' ? call_user_func_array('array_merge', $filters[$filter]['options']) : $filters[$filter]['options'];
+	$options = $filters[$filter]['option'];
+	if ($filter == 'permission') {
+	  $options = array();
+	  foreach ($filters[$filter]['option'] as $filtermodule) {
+	    $options += $filtermodule['#options'];
+	  }
+	}
         if (isset($options[$form_state['values'][$filter]])) {
           $_SESSION['user_overview_filter'][] = array($filter, $form_state['values'][$filter]);
         }
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.946
diff -u -p -r1.946 user.module
--- modules/user/user.module	16 Dec 2008 23:57:33 -0000	1.946
+++ modules/user/user.module	19 Dec 2008 08:57:44 -0000
@@ -1970,8 +1970,9 @@ function user_filters() {
     $function = $module . '_perm';
     if ($permissions = $function('perm')) {
       asort($permissions);
+      $options[t('@module module', array('@module' => $module))] = array('#options' => array());
       foreach ($permissions as $permission => $description) {
-        $options[t('@module module', array('@module' => $module))][$permission] = t($permission);
+        $options[t('@module module', array('@module' => $module))]['#options'][$permission] = t($permission);
       }
     }
   }
