Permalink
Browse files

Merge branch 'MDL-33780_21' of git://github.com/timhunt/moodle into M…

…OODLE_21_STABLE
  • Loading branch information...
2 parents a0ca809 + 8120005 commit 1f4a06853702badb1b75aee52b96018ab31ee128 @danpoltawski danpoltawski committed Jul 2, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 question/format.php
View
@@ -539,7 +539,10 @@ protected function readdata($filename) {
if (is_readable($filename)) {
$filearray = file($filename);
- /// Check for Macintosh OS line returns (ie file on one line), and fix
+ // If the first line of the file starts with a UTF-8 BOM, remove it.
+ $filearray[0] = textlib_get_instance()->trim_utf8_bom($filearray[0]);
+
+ // Check for Macintosh OS line returns (ie file on one line), and fix.
if (preg_match("~\r~", $filearray[0]) AND !preg_match("~\n~", $filearray[0])) {
return explode("\r", $filearray[0]);
} else {

0 comments on commit 1f4a068

Please sign in to comment.