From 1a6b93675b25cd66989b898bfea48e5d1b052e25 Mon Sep 17 00:00:00 2001 From: Eloy Lafuente Date: Thu, 8 Apr 2010 18:16:26 +0000 Subject: [PATCH] NOBUG: BOM rebombed from 19_STABLE --- mod/data/import.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mod/data/import.php b/mod/data/import.php index 61301497497..34ae1b0b566 100755 --- a/mod/data/import.php +++ b/mod/data/import.php @@ -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);