cvs diff: Diffing handlers
Index: handlers/views_handler_filter.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/handlers/views_handler_filter.inc,v
retrieving revision 1.10
diff -u -p -r1.10 views_handler_filter.inc
--- handlers/views_handler_filter.inc	26 Jun 2009 00:23:42 -0000	1.10
+++ handlers/views_handler_filter.inc	23 Sep 2009 08:18:55 -0000
@@ -451,6 +451,14 @@ class views_handler_filter extends views
     if ($form['#type'] == 'checkboxes') {
       if (empty($form['#no_convert']) || !empty($this->options['expose']['single'])) {
         $form['#type'] = 'select';
+        if (!empty($form['#process'])) {
+          foreach ($form['#process'] as $key => $callback) {
+            if ($callback == 'views_process_check_plain_options') {
+              unset($form['#process'][$key]);
+              break;
+            }
+          }
+        }
       }
       if (empty($this->options['expose']['single'])) {
         $form['#multiple'] = TRUE;
Index: handlers/views_handler_filter_in_operator.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/handlers/views_handler_filter_in_operator.inc,v
retrieving revision 1.11
diff -u -p -r1.11 views_handler_filter_in_operator.inc
--- handlers/views_handler_filter_in_operator.inc	1 Jul 2009 22:30:40 -0000	1.11
+++ handlers/views_handler_filter_in_operator.inc	23 Sep 2009 08:18:55 -0000
@@ -173,11 +173,6 @@ class views_handler_filter_in_operator e
     }
 
     if ($which == 'all' || $which == 'value') {
-      if ($this->value_form_type == 'checkboxes') {
-        foreach ($options as $key => $option) {
-          $options[$key] = check_plain($option);
-        }
-      }
       $form['value'] = array(
         '#type' => $this->value_form_type,
         '#title' => $this->value_title,
@@ -191,8 +186,17 @@ class views_handler_filter_in_operator e
         $form_state['input'][$identifier] = $default_value;
       }
 
+      $process = array();
+      if ($this->value_form_type == 'checkboxes') {
+        // If this form element will use checkboxes in the UI, we need to
+        // check_plain() all the options ourselves since FAPI is inconsistent
+        // about this. However, instead of directly doing that to the #options
+        // right now, we define a #process callback since we might change our
+        // mind later and convert this into a 'select' form element, which
+        // would lead to double-escaping the options.
+        $process[] = 'views_process_check_plain_options';
+      }
       if ($which == 'all') {
-        $process = array();
         if (empty($form_state['exposed']) && ($this->value_form_type == 'checkboxes' || $this->value_form_type == 'radios')) {
           $process[] = "expand_$this->value_form_type";
           $form['value']['#prefix'] = '<div id="edit-options-value-wrapper">';
@@ -200,10 +204,14 @@ class views_handler_filter_in_operator e
         }
         $process[] = 'views_process_dependency';
         $form['value'] += array(
-          '#process' => $process,
           '#dependency' => array($source => $this->operator_values(1)),
         );
       }
+      if (!empty($process)) {
+        $form['value'] += array(
+          '#process' => $process,
+        );
+      }
     }
   }
 
cvs diff: Diffing includes
Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/includes/form.inc,v
retrieving revision 1.10
diff -u -p -r1.10 form.inc
--- includes/form.inc	25 Jun 2008 21:10:10 -0000	1.10
+++ includes/form.inc	23 Sep 2009 08:18:55 -0000
@@ -280,3 +280,12 @@ function views_process_dependency($eleme
 
   return $element;
 }
+
+/**
+ * #process callback to check_plain() all the options for a form element.
+ */
+function views_process_check_plain_options($element, $edit, &$form_state, &$form) {
+  $element['#options'] = array_map('check_plain', $element['#options']);
+  return $element;
+}
+
