Index: apachesolr.index.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/Attic/apachesolr.index.inc,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 apachesolr.index.inc
--- apachesolr.index.inc	28 Apr 2009 18:45:25 -0000	1.1.2.2
+++ apachesolr.index.inc	28 Apr 2009 20:13:19 -0000
@@ -30,7 +30,9 @@ function apachesolr_strip_ctl_chars($tex
 function apachesolr_clean_text($text) {
   $text = preg_replace('@[\x00-\x08\x0B\x0C\x0E-\x1F]@', ' ', $text);
   // Add spaces before stripping tags to avoid running words together.
-  return strip_tags(str_replace(array('<', '>'), array(' <', '> '), $text));
+  $text = filter_xss(str_replace(array('<', '>'), array(' <', '> '), $text), array());
+  // Decode entities and then make safe any < or > characters.
+  return htmlspecialchars(html_entity_decode($text, ENT_NOQUOTES, 'UTF-8'), ENT_NOQUOTES, 'UTF-8', FALSE);
 }
 
 /**
@@ -123,12 +125,13 @@ function apachesolr_node_to_document($ni
         $index_key = apachesolr_index_key($cck_info);
         foreach ($field as $value) {
           // Don't index NULLs or empty strings
-          if (isset($value['safe']) && strlen($value['safe'])) {
+          // We can use 'value' rather than 'safe' since we strip tags and later check_plain().
+          if (isset($value['value']) && strlen($value['value'])) {
             if ($cck_info['multiple']) {
-              $document->setMultiValue($index_key, apachesolr_clean_text($value['safe']));
+              $document->setMultiValue($index_key, apachesolr_clean_text($value['value']));
             }
             else {
-              $document->$index_key = apachesolr_clean_text($value['safe']);
+              $document->$index_key = apachesolr_clean_text($value['value']);
             }
           }
         }
