mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Remove UTF-8 BOM and CRLF in templates when compiling them
This commit is contained in:
parent
55d3dd047c
commit
a50041007d
2 changed files with 4 additions and 1 deletions
|
|
@ -286,6 +286,9 @@ class TemplateHandler
|
|||
// detect existence of autoescape config
|
||||
$this->config->autoescape = (strpos($buff, ' autoescape="') === false) ? null : false;
|
||||
|
||||
// remove UTF-8 BOM and convert CRLF to LF
|
||||
$buff = preg_replace(['/^\xEF\xBB\xBF/', '/\r\n/'], ['', "\n"], $buff);
|
||||
|
||||
// replace comments
|
||||
$buff = preg_replace('@<!--//.*?-->@s', '', $buff);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue