- enhancement remove BOM automatically from template source (topic 25161)

This commit is contained in:
Uwe.Tews@googlemail.com
2014-07-16 18:21:25 +00:00
parent c2bba29216
commit 77292d394a
4 changed files with 11 additions and 1 deletions

View File

@@ -1,4 +1,7 @@
===== 3.1.20-dev ===== (xx.xx.2014) ===== 3.1.20-dev ===== (xx.xx.2014)
16.07.2014
- enhancement remove BOM automatically from template source (topic 25161)
04.07.2014 04.07.2014
- bugfix the bufix of 02.06.2014 broke correct handling of child templates with same name but different template folders in extends resource (issue 194 and topic 25099) - bugfix the bufix of 02.06.2014 broke correct handling of child templates with same name but different template folders in extends resource (issue 194 and topic 25099)

View File

@@ -33,6 +33,9 @@ class Smarty_Internal_Configfilelexer
self::instance($this); self::instance($this);
$this->data = $data . "\n"; //now all lines are \n-terminated $this->data = $data . "\n"; //now all lines are \n-terminated
$this->counter = 0; $this->counter = 0;
if (preg_match('/\xEF\xBB\xBF/', $this->data, $match)) {
$this->counter += strlen($match[0]);
}
$this->line = 1; $this->line = 1;
$this->compiler = $compiler; $this->compiler = $compiler;
$this->smarty = $compiler->smarty; $this->smarty = $compiler->smarty;

View File

@@ -82,6 +82,9 @@ class Smarty_Internal_Templatelexer
// $this->data = preg_replace("/(\r\n|\r|\n)/", "\n", $data); // $this->data = preg_replace("/(\r\n|\r|\n)/", "\n", $data);
$this->data = $data; $this->data = $data;
$this->counter = 0; $this->counter = 0;
if (preg_match('/\xEF\xBB\xBF/', $this->data, $match)) {
$this->counter += strlen($match[0]);
}
$this->line = 1; $this->line = 1;
$this->smarty = $compiler->smarty; $this->smarty = $compiler->smarty;
$this->compiler = $compiler; $this->compiler = $compiler;

View File

@@ -2662,7 +2662,8 @@ class Smarty_Internal_Templateparser #line 80 "smarty_internal_templateparser.ph
if (isset(self::$yyExpectedTokens[$nextstate])) { if (isset(self::$yyExpectedTokens[$nextstate])) {
$expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]); $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]);
if (in_array($token, if (in_array($token,
self::$yyExpectedTokens[$nextstate], true)) { self::$yyExpectedTokens[$nextstate], true)
) {
$this->yyidx = $yyidx; $this->yyidx = $yyidx;
$this->yystack = $stack; $this->yystack = $stack;