mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 10:54:27 +02:00
anchor BOM regex to front of file
This commit is contained in:
@@ -33,7 +33,7 @@ class Smarty_Internal_Configfilelexer
|
||||
self::instance($this);
|
||||
$this->data = $data . "\n"; //now all lines are \n-terminated
|
||||
$this->counter = 0;
|
||||
if (preg_match('/\xEF\xBB\xBF/', $this->data, $match)) {
|
||||
if (preg_match('/^\xEF\xBB\xBF/', $this->data, $match)) {
|
||||
$this->counter += strlen($match[0]);
|
||||
}
|
||||
$this->line = 1;
|
||||
|
@@ -82,7 +82,7 @@ class Smarty_Internal_Templatelexer
|
||||
// $this->data = preg_replace("/(\r\n|\r|\n)/", "\n", $data);
|
||||
$this->data = $data;
|
||||
$this->counter = 0;
|
||||
if (preg_match('/\xEF\xBB\xBF/', $this->data, $match)) {
|
||||
if (preg_match('/^\xEF\xBB\xBF/', $this->data, $match)) {
|
||||
$this->counter += strlen($match[0]);
|
||||
}
|
||||
$this->line = 1;
|
||||
|
Reference in New Issue
Block a user