Index: codefilter/codefilter.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/codefilter/codefilter.module,v
retrieving revision 1.21.2.6
diff -u -p -r1.21.2.6 codefilter.module
--- codefilter/codefilter.module	6 Dec 2007 02:04:04 -0000	1.21.2.6
+++ codefilter/codefilter.module	12 Jan 2008 09:29:48 -0000
@@ -101,15 +101,15 @@ function codefilter_filter($op, $delta =
       return t('Allows users to post code verbatim using &lt;code&gt; and &lt;?php ?&gt; tags.');
 
     case 'prepare':
-      // Note: we use the bytes 0xFE and 0xFF to replace < > during the filtering process.
-      // These bytes are not valid in UTF-8 data and thus least likely to cause problems.
-      $text = preg_replace('@<code>(.+?)</code>@se', "'\xFEcode\xFF'. codefilter_escape('\\1') .'\xFE/code\xFF'", $text);
-      $text = preg_replace('@[\[<](\?php|%)(.+?)(\?|%)[\]>]@se', "'\xFEphp\xFF'. codefilter_escape('\\2') .'\xFE/php\xFF'", $text);
+      // Note: we use the bytes 0x01 and 0x02 to replace < > during the filtering process.
+      // These bytes are valid in UTF-8 data and thus will not cause problems with drupal_validate_utf8().
+      $text = preg_replace('@<code>(.+?)</code>@se', "'\x01code\x02'. codefilter_escape('\\1') .'\x01/code\x02'", $text);
+      $text = preg_replace('@[\[<](\?php|%)(.+?)(\?|%)[\]>]@se', "'\x01php\x02'. codefilter_escape('\\2') .'\x01/php\x02'", $text);
       return $text;
 
     case 'process':
-      $text = preg_replace('@\xFEcode\xFF(.+?)\xFE/code\xFF@se', "codefilter_process_code('$1')", $text);
-      $text = preg_replace('@\xFEphp\xFF(.+?)\xFE/php\xFF@se', "codefilter_process_php('$1')", $text);
+      $text = preg_replace('@\x01code\x02(.+?)\x01/code\x02@se', "codefilter_process_code('$1')", $text);
+      $text = preg_replace('@\x01php\x02(.+?)\x01/php\x02@se', "codefilter_process_php('$1')", $text);
       return $text;
 
     default:
