Index: modules/block/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.module,v
retrieving revision 1.312
diff -u -p -r1.312 block.module
--- modules/block/block.module	9 Oct 2008 15:15:50 -0000	1.312
+++ modules/block/block.module	5 Nov 2008 19:44:02 -0000
@@ -213,7 +213,7 @@ function block_block($op = 'list', $delt
 
     case 'view':
       $block = db_fetch_object(db_query('SELECT body, format FROM {boxes} WHERE bid = %d', $delta));
-      $data['content'] = check_markup($block->body, $block->format, FALSE);
+      $data['content'] = check_markup($block->body, $block->format, '', FALSE);
       return $data;
   }
 }
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.660
diff -u -p -r1.660 comment.module
--- modules/comment/comment.module	1 Nov 2008 19:51:06 -0000	1.660
+++ modules/comment/comment.module	5 Nov 2008 19:44:02 -0000
@@ -604,7 +604,7 @@ function comment_nodeapi_update_index(&$
   $text = '';
   $comments = db_query('SELECT subject, comment, format FROM {comments} WHERE nid = %d AND status = %d', $node->nid, COMMENT_PUBLISHED);
   while ($comment = db_fetch_object($comments)) {
-    $text .= '<h2>' . check_plain($comment->subject) . '</h2>' . check_markup($comment->comment, $comment->format, FALSE);
+    $text .= '<h2>' . check_plain($comment->subject) . '</h2>' . check_markup($comment->comment, $comment->format, '', FALSE);
   }
   return $text;
 }
@@ -1597,7 +1597,7 @@ function theme_comment_view($comment, $n
 
   // Switch to folded/unfolded view of the comment.
   if ($visible) {
-    $comment->comment = check_markup($comment->comment, $comment->format, FALSE);
+    $comment->comment = check_markup($comment->comment, $comment->format, '', FALSE);
     // Comment API hook.
     comment_invoke_comment($comment, 'view');
     $output .= theme('comment', $comment, $node, $links);
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.231
diff -u -p -r1.231 filter.module
--- modules/filter/filter.module	1 Nov 2008 19:51:06 -0000	1.231
+++ modules/filter/filter.module	5 Nov 2008 19:44:02 -0000
@@ -409,6 +409,8 @@ function filter_list_format($format) {
  * @param $format
  *    The format of the text to be filtered. Specify FILTER_FORMAT_DEFAULT for
  *    the default format.
+ * @param $language
+ *    Optional: the language of the text to be filtered.
  * @param $check
  *    Whether to check the $format with filter_access() first. Defaults to TRUE.
  *    Note that this will check the permissions of the current user, so you
@@ -416,13 +418,13 @@ function filter_list_format($format) {
  *    showing content that is not (yet) stored in the database (eg. upon preview),
  *    set to TRUE so the user's permissions are checked.
  */
-function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $check = TRUE) {
+function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $language = '', $check = TRUE) {
   // When $check = TRUE, do an access check on $format.
   if (isset($text) && (!$check || filter_access($format))) {
     $format = filter_resolve_format($format);
 
     // Check for a cached version of this piece of text.
-    $cache_id = $format . ':' . md5($text);
+    $cache_id = $format . ':' $language . ':' . md5($text);
     if ($cached = cache_get($cache_id, 'cache_filter')) {
       return $cached->data;
     }
@@ -439,12 +441,12 @@ function check_markup($text, $format = F
 
     // Give filters the chance to escape HTML-like data such as code or formulas.
     foreach ($filters as $filter) {
-      $text = module_invoke($filter->module, 'filter', 'prepare', $filter->delta, $format, $text, $cache_id);
+      $text = module_invoke($filter->module, 'filter', 'prepare', $filter->delta, $format, $text, $language, $cache_id);
     }
 
     // Perform filtering.
     foreach ($filters as $filter) {
-      $text = module_invoke($filter->module, 'filter', 'process', $filter->delta, $format, $text, $cache_id);
+      $text = module_invoke($filter->module, 'filter', 'process', $filter->delta, $format, $text, $language, $cache_id);
     }
 
     // Store in cache with a minimum expiration time of 1 day.
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.993
diff -u -p -r1.993 node.module
--- modules/node/node.module	3 Nov 2008 05:55:56 -0000	1.993
+++ modules/node/node.module	5 Nov 2008 19:44:02 -0000
@@ -1088,10 +1088,10 @@ function node_prepare($node, $teaser = F
   $node->readmore = (strlen($node->teaser) < strlen($node->body));
 
   if ($teaser == FALSE) {
-    $node->body = check_markup($node->body, $node->format, FALSE);
+    $node->body = check_markup($node->body, $node->format, $node->language, FALSE);
   }
   else {
-    $node->teaser = check_markup($node->teaser, $node->format, FALSE);
+    $node->teaser = check_markup($node->teaser, $node->format, $node->language, FALSE);
   }
 
   $node->content['body'] = array(
