diff --git a/libs/sysplugins/smarty_internal_configfilelexer.php b/libs/sysplugins/smarty_internal_configfilelexer.php index d5b50775..f0292196 100644 --- a/libs/sysplugins/smarty_internal_configfilelexer.php +++ b/libs/sysplugins/smarty_internal_configfilelexer.php @@ -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; diff --git a/libs/sysplugins/smarty_internal_templatelexer.php b/libs/sysplugins/smarty_internal_templatelexer.php index 45583d9b..5a04d0b6 100644 --- a/libs/sysplugins/smarty_internal_templatelexer.php +++ b/libs/sysplugins/smarty_internal_templatelexer.php @@ -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;