使用PHP5(cgi)从文件系统输出模板文件,并在输出原始HTML时遇到问题.
private function fetch($name) {
$path = $this->j->config['template_path'] . $name . '.html';
if (!file_exists($path)) {
dbgerror('Could not find the template "' . $name . '" in ' . $path);
}
$f = fopen($path, 'r');
$t = fread($f, filesize($path));
fclose($f);
if (substr($t, 0, 3) == b'\xef\xbb\xbf') {
$t = substr($t, 3);
}
return $t;
}
尽管我已经添加了BOM修正,但Firefox接受它仍然存在问题.你可以在这里看到一个实时副本:http://ircb.in/jisti/(如果你想查看的话,我抛出的模板文件是http://ircb.in/jisti/home.html)
知道怎么解决吗?欧欧欧