Permalink
Browse files

NOBUG: Bombing BOM: BOM bombed

  • Loading branch information...
1 parent 4967d90 commit 68715e174c1f654ef2482ed0eeebd6f7b722750a @stronk7 stronk7 committed Apr 8, 2010
Showing with 4 additions and 1 deletion.
  1. +4 −1 mod/data/import.php
View
@@ -92,9 +92,12 @@
@apache_child_terminate();
}
- //Fix mac/dos newlines
+ // Fix mac/dos newlines and clean BOM
+ // 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);

0 comments on commit 68715e1

Please sign in to comment.