Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.756.2.97 diff -u -p -r1.756.2.97 common.inc --- includes/common.inc 11 Aug 2010 21:10:41 -0000 1.756.2.97 +++ includes/common.inc 12 Aug 2010 04:01:33 -0000 @@ -164,7 +164,10 @@ function drupal_get_headers() { function drupal_final_markup($content) { // Make sure that the charset is always specified as the first element of the // head region to prevent encoding-based attacks. - return preg_replace('/]*>/i', "\$0\n", $content, 1); + if (!preg_match('/]*>\s*/', $content)) { + $content = preg_replace('/]*>/i', "\$0\n", $content, 1); + } + return $content; } /**