mirror of
https://github.com/smarty-php/smarty.git
synced 2025-06-25 15:01:37 +02:00
- improvement show resource type and start of template source instead of uid on eval: and string: resource (forum topic 25630)
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
===== 3.1.28-dev===== (xx.xx.2015)
|
||||
01.08.2015
|
||||
- update DateTime object can be instance of DateTimeImmutable since PHP5.5 https://github.com/smarty-php/smarty/pull/75
|
||||
|
||||
- improvement show resource type and start of template source instead of uid on eval: and string: resource (forum topic 25630)
|
||||
|
||||
31.07.2015
|
||||
- optimize {foreach} and {section} compiler
|
||||
|
||||
|
@ -111,7 +111,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
||||
/**
|
||||
* smarty version
|
||||
*/
|
||||
const SMARTY_VERSION = '3.1.28-dev/35';
|
||||
const SMARTY_VERSION = '3.1.28-dev/36';
|
||||
|
||||
/**
|
||||
* define variable scopes
|
||||
|
@ -1079,10 +1079,18 @@ abstract class Smarty_Internal_TemplateCompilerBase
|
||||
if (!isset($line)) {
|
||||
$line = $this->lex->line;
|
||||
}
|
||||
if (in_array($this->template->source->type, array('eval', 'string'))) {
|
||||
$templateName = $this->template->source->type . ':' .
|
||||
trim(preg_replace('![\t\r\n]+!', ' ', strlen($this->lex->data) > 40 ? substr($this->lex->data, 0, 40) .
|
||||
'...' : $this->lex->data));
|
||||
} else {
|
||||
$templateName = $this->template->source->type . ':' . $this->template->source->filepath;
|
||||
}
|
||||
|
||||
// $line += $this->trace_line_offset;
|
||||
$match = preg_split("/\n/", $this->lex->data);
|
||||
$error_text = 'Syntax error in template "' .
|
||||
(empty($this->trace_filepath) ? $this->template->source->filepath : $this->trace_filepath) . '" on line ' .
|
||||
(empty($this->trace_filepath) ? $templateName : $this->trace_filepath) . '" on line ' .
|
||||
($line + $this->trace_line_offset) . ' "' . trim(preg_replace('![\t\r\n]+!', ' ', $match[$line - 1])) .
|
||||
'" ';
|
||||
if (isset($args)) {
|
||||
|
Reference in New Issue
Block a user