Index: apachesolr.index.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr.index.inc,v
retrieving revision 1.1.2.5
diff -u -p -r1.1.2.5 apachesolr.index.inc
--- apachesolr.index.inc	19 May 2009 19:58:23 -0000	1.1.2.5
+++ apachesolr.index.inc	1 Jul 2009 22:35:41 -0000
@@ -28,14 +28,13 @@ function apachesolr_strip_ctl_chars($tex
  * Strip html tags and also control characters that cause Jetty/Solr to fail.
  */
 function apachesolr_clean_text($text) {
-  return _apachesolr_strip_decode(preg_replace('@[\x00-\x08\x0B\x0C\x0E-\x1F]@', ' ', $text));
-}
-
-function _apachesolr_strip_decode($text) {
   // Add spaces before stripping tags to avoid running words together.
   $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');
+  $text = htmlspecialchars(html_entity_decode($text, ENT_NOQUOTES, 'UTF-8'), ENT_NOQUOTES, 'UTF-8');
+  // We must strip low bytes second in case there was an encoded
+  // low-byte character.
+  return apachesolr_strip_ctl_chars($text);
 }
 
 /**
@@ -88,7 +87,7 @@ function apachesolr_node_to_document($ni
     if (!empty($node->language)) {
       $document->language = $node->language;
     }
-    $document->body = _apachesolr_strip_decode($text);
+    $document->body = apachesolr_clean_text($text);
     $document->type  = $node->type;
     $document->type_name = apachesolr_strip_ctl_chars(node_get_types('name', $node));
     $document->created = apachesolr_date_iso($node->created);
Index: apachesolr.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr.module,v
retrieving revision 1.1.2.12.2.150
diff -u -p -r1.1.2.12.2.150 apachesolr.module
--- apachesolr.module	30 Jun 2009 10:57:24 -0000	1.1.2.12.2.150
+++ apachesolr.module	1 Jul 2009 22:35:41 -0000
@@ -338,7 +338,14 @@ function apachesolr_index_nodes($rows, $
       apachesolr_index_updated(time());
     }
     catch (Exception $e) {
-      watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
+      $nids = array();
+      if (!empty($docs)) {
+        foreach ($docs as $doc) {
+          $nids[] = $doc->nid;
+        }
+      }
+      watchdog('Apache Solr', 'Indexing failed on one of the following nodes: @nids <br /> !message',
+               array('@nids' => implode(', ', $nids), '!message' => nl2br(strip_tags($e->getMessage()))), WATCHDOG_ERROR);
       return FALSE;
     }
   }
