Index: apachesolr.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr.admin.inc,v
retrieving revision 1.1.2.19
diff -u -p -r1.1.2.19 apachesolr.admin.inc
--- apachesolr.admin.inc	7 May 2009 16:05:55 -0000	1.1.2.19
+++ apachesolr.admin.inc	9 Jun 2009 00:39:17 -0000
@@ -89,8 +89,8 @@ function apachesolr_index_page() {
     $data = $solr->getLuke();
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', $e->getMessage(), NULL, WATCHDOG_ERROR);
-    drupal_set_message($e->getMessage(), "warning");
+    watchdog('Apache Solr', check_plain($e->getMessage()), NULL, WATCHDOG_ERROR);
+    drupal_set_message(check_plain($e->getMessage()), "warning");
     $data->fields = array();
   }
 
@@ -103,7 +103,7 @@ function apachesolr_index_page() {
       $delete_msg = '<p>' . t('Numer of pending deletions: @deletes_total', $stats_summary) . "</p>\n";
     }
     catch (Exception $e) {
-      watchdog('Apache Solr', $e->getMessage(), NULL, WATCHDOG_ERROR);
+      watchdog('Apache Solr', check_plain($e->getMessage()), NULL, WATCHDOG_ERROR);
     }
     $output .= $delay_msg;
     $pending_msg = $stats_summary['@pending_docs'] ? t('(@pending_docs sent but not yet processed)', $stats_summary) : '';
@@ -127,8 +127,8 @@ function apachesolr_index_report() {
     $data = $solr->getLuke();
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', $e->getMessage(), NULL, WATCHDOG_ERROR);
-    drupal_set_message($e->getMessage(), "warning");
+    watchdog('Apache Solr', check_plain($e->getMessage()), NULL, WATCHDOG_ERROR);
+    drupal_set_message(check_plain($e->getMessage()), "warning");
     $data->fields = array();
   }
 
@@ -148,7 +148,7 @@ function apachesolr_index_report() {
       $output .= '<p>' . t('Number of terms in index: @num', array('@num' => $data->index->numTerms)) . "</p>\n";
     }
     catch (Exception $e) {
-      watchdog('Apache Solr', $e->getMessage(), NULL, WATCHDOG_ERROR);
+      watchdog('Apache Solr', check_plain($e->getMessage()), NULL, WATCHDOG_ERROR);
       $data->fields = array();
     }
   }
@@ -348,7 +348,7 @@ function apachesolr_delete_index_confirm
     drupal_set_message(t('The Apache Solr content index has been erased. You must now !run_cron until your entire site has been re-indexed.', array('!run_cron' => l(t('run cron'), 'admin/reports/status/run-cron', array('query' => array('destination' => 'admin/settings/apachesolr/index'))))));
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', $e->getMessage(), NULL, WATCHDOG_ERROR);
+    watchdog('Apache Solr', check_plain($e->getMessage()), NULL, WATCHDOG_ERROR);
   }
 }
 
Index: apachesolr.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr.module,v
retrieving revision 1.1.2.12.2.143
diff -u -p -r1.1.2.12.2.143 apachesolr.module
--- apachesolr.module	8 Jun 2009 17:23:36 -0000	1.1.2.12.2.143
+++ apachesolr.module	9 Jun 2009 00:39:17 -0000
@@ -126,7 +126,7 @@ function apachesolr_requirements($phase)
       }
     }
     catch (Exception $e) {
-      watchdog('Apache Solr', $e->getMessage(), NULL, WATCHDOG_ERROR);
+      watchdog('Apache Solr', check_plain($e->getMessage()), NULL, WATCHDOG_ERROR);
     }
     $value =  $ping ? $t('Your site has contacted the Apache Solr server.') : $t('Your site was unable to contact the Apache Solr server.');
     $severity = $ping ? 0: 2;
@@ -308,7 +308,7 @@ function apachesolr_index_nodes($rows, $
     }
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', $e->getMessage(), NULL, WATCHDOG_ERROR);
+    watchdog('Apache Solr', check_plain($e->getMessage()), NULL, WATCHDOG_ERROR);
     return FALSE;
   }
   include_once(drupal_get_path('module', 'apachesolr') .'/apachesolr.index.inc') ;
@@ -335,7 +335,7 @@ function apachesolr_index_nodes($rows, $
       apachesolr_index_updated(time());
     }
     catch (Exception $e) {
-      watchdog('Apache Solr', $e->getMessage(), NULL, WATCHDOG_ERROR);
+      watchdog('Apache Solr', check_plain($e->getMessage()), NULL, WATCHDOG_ERROR);
       return FALSE;
     }
   }
@@ -366,7 +366,7 @@ function apachesolr_delete_node_from_ind
     return TRUE;
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', $e->getMessage(), NULL, WATCHDOG_ERROR);
+    watchdog('Apache Solr', check_plain($e->getMessage()), NULL, WATCHDOG_ERROR);
     return FALSE;
   }
 }
@@ -430,7 +430,7 @@ function apachesolr_cron() {
     }
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', $e->getMessage() . ' in apachesolr_cron', NULL, WATCHDOG_ERROR);
+    watchdog('Apache Solr', check_plain($e->getMessage()) . ' in apachesolr_cron', NULL, WATCHDOG_ERROR);
   }
 }
 
@@ -497,7 +497,7 @@ function apachesolr_set_stats_message($t
     drupal_set_message(t($text, $stats_summary), $type, FALSE);
   }
   catch (Exception $e) {
-    watchdog('apachesolr', $e->getMessage(), NULL, WATCHDOG_ERROR);
+    watchdog('apachesolr', check_plain($e->getMessage()), NULL, WATCHDOG_ERROR);
   }
 }
 
@@ -1022,7 +1022,7 @@ function apachesolr_get_solr($host = NUL
       $solr_cache[$host][$port][$path] = new $class($host, $port, $path);
     }
     catch (Exception $e) {
-      watchdog('Apache Solr', $e->getMessage(), NULL, WATCHDOG_ERROR);
+      watchdog('Apache Solr', check_plain($e->getMessage()), NULL, WATCHDOG_ERROR);
       return;
     }
   }
@@ -1066,7 +1066,7 @@ function apachesolr_drupal_query($keys =
     $query = new $class(apachesolr_get_solr(), $keys, $filters, $solrsort, $base_path);
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', $e->getMessage(), NULL, WATCHDOG_ERROR);
+    watchdog('Apache Solr', check_plain($e->getMessage()), NULL, WATCHDOG_ERROR);
     $query = NULL;
   }
   
@@ -1253,7 +1253,7 @@ function apachesolr_mlt_suggestions($set
     }
   } 
   catch ( Exception $e ) {
-    watchdog('Apache Solr', $e->getMessage(), NULL, WATCHDOG_ERROR );
+    watchdog('Apache Solr', check_plain($e->getMessage()), NULL, WATCHDOG_ERROR );
   }
 }
 
Index: apachesolr_search.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr_search.admin.inc,v
retrieving revision 1.1.2.16
diff -u -p -r1.1.2.16 apachesolr_search.admin.inc
--- apachesolr_search.admin.inc	6 May 2009 16:34:19 -0000	1.1.2.16
+++ apachesolr_search.admin.inc	9 Jun 2009 00:39:17 -0000
@@ -17,8 +17,8 @@ function apachesolr_search_settings_page
     $output .= drupal_get_form('apachesolr_search_settings_form', $fields);
   }
   catch (Exception $e) {
-    watchdog('apachesolr', $e->getMessage());
-    drupal_set_message($e->getMessage(), "warning");
+    watchdog('apachesolr', check_plain($e->getMessage()));
+    drupal_set_message(check_plain($e->getMessage()), "warning");
     $output .= t('Cannot get information about the fields in the index at this time.');
   }
   return $output;
Index: apachesolr_search.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr_search.module,v
retrieving revision 1.1.2.6.2.94
diff -u -p -r1.1.2.6.2.94 apachesolr_search.module
--- apachesolr_search.module	8 Jun 2009 17:23:36 -0000	1.1.2.6.2.94
+++ apachesolr_search.module	9 Jun 2009 00:39:17 -0000
@@ -690,7 +690,7 @@ function apachesolr_search_build_spellch
     $response = $solr->search('solr', 0, 0, $params);
   }
   catch (Exception $e) {
-    watchdog('Apache Solr', $e->getMessage(), NULL, WATCHDOG_ERROR);
+    watchdog('Apache Solr', check_plain($e->getMessage()), NULL, WATCHDOG_ERROR);
   }
 }
 
Index: Drupal_Apache_Solr_Service.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/Drupal_Apache_Solr_Service.php,v
retrieving revision 1.1.2.18
diff -u -p -r1.1.2.18 Drupal_Apache_Solr_Service.php
--- Drupal_Apache_Solr_Service.php	5 Jun 2009 12:34:36 -0000	1.1.2.18
+++ Drupal_Apache_Solr_Service.php	9 Jun 2009 00:39:17 -0000
@@ -209,7 +209,7 @@ class Drupal_Apache_Solr_Service extends
     $code = (int) $response->getHttpStatus();
     if ($code != 200) {
       $message = $response->getHttpStatusMessage();
-      if ($code >= 400) {
+      if ($code >= 400 && $code != 403 && $code != 404) {
         // Add details, like Solr's exception message.
         $message .= $response->getRawResponse();
       }
@@ -230,7 +230,7 @@ class Drupal_Apache_Solr_Service extends
     $code = (int) $response->getHttpStatus();
     if ($code != 200) {
       $message = $response->getHttpStatusMessage();
-      if ($code >= 400) {
+      if ($code >= 400 && $code != 403 && $code != 404) {
         // Add details, like Solr's exception message.
         $message .= $response->getRawResponse();
       }
