NOBUG: BOM rebombed from 19_STABLE

This commit is contained in:
Eloy Lafuente 2010-04-08 18:16:26 +00:00
parent 7b55e20a2a
commit 1a6b93675b

View File

@ -108,9 +108,12 @@ if ($um->preprocess_files() && confirm_sesskey()) {
@apache_child_terminate();
}
//Fix mac/dos newlines
// Fix mac/dos newlines
// TODO: Switch to cvslib when possible
$textlib = textlib_get_instance();
$text = my_file_get_contents($filename);
$text = preg_replace('!\r\n?!',"\n",$text);
$text = $textlib->trim_utf8_bom($text); // remove Unicode BOM from first line
$fp = fopen($filename, "w");
fwrite($fp, $text);
fclose($fp);