MDL-35850 - Lib - csv files are now trimmed for white space and new lines at the end of the file.

This commit is contained in:
Adrian Greeve
2012-10-09 13:16:26 +08:00
parent ccd90e765e
commit f417479e3d
+2
View File
@@ -90,6 +90,8 @@ class csv_import_reader {
$content = textlib::trim_utf8_bom($content);
// Fix mac/dos newlines
$content = preg_replace('!\r\n?!', "\n", $content);
// Remove any spaces or new lines at the end of the file.
$content = trim($content);
$csv_delimiter = csv_import_reader::get_delimiter($delimiter_name);
// $csv_encode = csv_import_reader::get_encoded_delimiter($delimiter_name);