Index: l10n_community/l10n_community.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/l10n_server/l10n_community/Attic/l10n_community.module,v
retrieving revision 1.1.2.23.2.56
diff -u -p -r1.1.2.23.2.56 l10n_community.module
--- l10n_community/l10n_community.module	2 Oct 2009 09:03:29 -0000	1.1.2.23.2.56
+++ l10n_community/l10n_community.module	7 Oct 2009 18:17:58 -0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: l10n_community.module,v 1.1.2.23.2.56 2009/10/02 09:03:29 goba Exp $
+// $Id: l10n_community.module,v 1.1.2.23.2.54 2009/09/30 12:17:08 goba Exp $
 
 /**
  * @file
@@ -1182,9 +1182,12 @@ function l10n_community_target_save($sid
  *   Translation string with the right beginning and ending chars.
  */
 function l10n_community_trim($translation, $source) {
-  $matches = array();
-  preg_match("/^(\s*).*\S(\s*)\$/s", $source, $matches);
-  return $matches[1] . trim($translation) . $matches[2];
+  if (is_string($translation) && is_string($source)) {
+    $matches = array();
+    preg_match("/^(\s*).*\S(\s*)\$/s", $source, $matches);
+    return $matches[1] . trim($translation) . $matches[2];
+  }
+  return $translation;
 }
 
 /**
