ให้เข้าไปแก้ lib/filelib.php นะคะ Moodle คงคิดว่า txt ไฟล์นั้นเป็นไฟล์ html มีการเพิ่ม syntax ที่ไม่จำเป็นลงไปในโค้ด ให้เปิดไฟล์ดังแล้ว comment บรรทัดข้างล่างนี้ทิ้งไปค่ะ if ($mimetype == 'text/html') { $options->noclean = true; $text = $pathisstring ? $path : implode('', file($path)); $output = format_text($text, FORMAT_HTML, $options, $courseid);
@header('Content-length: '.strlen($output)); @header('Content-type: text/html'); echo $output; } else if ($mimetype == 'text/plain') { $options->newlines = false; $options->noclean = true; $text = htmlentities($pathisstring ? $path : implode('', file($path))); $output = '<pre>'. format_text($text, FORMAT_MOODLE, $options, $courseid) .'</pre>'; @header('Content-length: '.strlen($output)); @header('Content-type: text/html; charset='. get_string('thischarset')); //add encoding echo $output;
} else { // Just send it out raw @header('Content-length: '.$filesize); @header('Content-type: '.$mimetype); if ($pathisstring) {
|