Merge branch 'v3.1.18'

This commit is contained in:
Uwe Tews
2014-10-31 02:15:15 +01:00
12 changed files with 2830 additions and 2698 deletions

View File

@@ -1,5 +1,42 @@
===== trunk ===== ===== 3.1.19-dev ===== (xx.xx.2014)
19.04.2014
- bugfix calling createTemplate(template, data) with empty data array caused notice of array to string conversion (Issue 189)
- bugfix clearCompiledTemplate() did not delete files on WINDOWS when a compile_id was specified
18.04.2014
- revert bugfix of 5.4.2015 because %-e date format is not supported on all operating systems
===== 3.1.18 ===== (07.04.2014)
06.04.2014
- bugfix template inheritance fail when using custom resource after patch of 8.3.2014 (Issue 187)
- bugfix update of composer file (Issue 168 and 184)
05.04.2014
- bugfix default date format leads to extra spaces when displaying dates with single digit days (Issue 165)
26.03.2014
- bugfix Smart_Resource_Custom should not lowercase the resource name (Issue 183)
24.03.2014
- bugfix using a {foreach} property like @iteration could fail when used in inheritance parent templates (Issue 182)
20.03.2014
- bugfix $smarty->auto_literal and mbsting.func_overload 2, 6 or 7 did fail (forum topic 24899)
18.03.2014
- revert change of 17.03.2014
17.03.2014
- bugfix $smarty->auto_literal and mbsting.func_overload 2, 6 or 7 did fail (forum topic 24899)
15.03.2014
- bugfix Smarty_CacheResource_Keyvaluestore did use different keys on read/writes and clearCache() calls (Issue 169)
13.03.2014
- bugfix clearXxx() change of 27.1.2014 did not work when specifing cache_id or compile_id (forum topic 24868 and 24867)
===== 3.1.17 ===== ===== 3.1.17 =====
08.03.2014 08.03.2014
- bugfix relative file path {include} within {block} of child templates did throw exception on first call (Issue 177) - bugfix relative file path {include} within {block} of child templates did throw exception on first call (Issue 177)

View File

@@ -113,7 +113,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/** /**
* smarty version * smarty version
*/ */
const SMARTY_VERSION = 'Smarty-3.1-DEV'; const SMARTY_VERSION = 'Smarty-3.1.19-dev';
/** /**
* define variable scopes * define variable scopes
@@ -1220,11 +1220,11 @@ class Smarty extends Smarty_Internal_TemplateBase
*/ */
public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true) public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true)
{ {
if (!empty($cache_id) && (is_object($cache_id) || is_array($cache_id))) { if ($cache_id !== null && (is_object($cache_id) || is_array($cache_id))) {
$parent = $cache_id; $parent = $cache_id;
$cache_id = null; $cache_id = null;
} }
if (!empty($parent) && is_array($parent)) { if ($parent !== null && is_array($parent)) {
$data = $parent; $data = $parent;
$parent = null; $parent = null;
} else { } else {

View File

@@ -54,7 +54,7 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource
public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template) public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template)
{ {
$cached->filepath = $_template->source->uid $cached->filepath = $_template->source->uid
. '#' . $this->sanitize($cached->source->name) . '#' . $this->sanitize($cached->source->resource)
. '#' . $this->sanitize($cached->cache_id) . '#' . $this->sanitize($cached->cache_id)
. '#' . $this->sanitize($cached->compile_id); . '#' . $this->sanitize($cached->compile_id);

View File

@@ -139,7 +139,7 @@
$_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null; $_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null;
$_dir_sep = $smarty->use_sub_dirs ? '/' : '^'; $_dir_sep = $smarty->use_sub_dirs ? '/' : '^';
$_compile_id_offset = $smarty->use_sub_dirs ? 3 : 0; $_compile_id_offset = $smarty->use_sub_dirs ? 3 : 0;
$_dir = realpath($smarty->getCacheDir()); $_dir = realpath($smarty->getCacheDir()) . '/';
$_dir_length = strlen($_dir); $_dir_length = strlen($_dir);
if (isset($_cache_id)) { if (isset($_cache_id)) {
$_cache_id_parts = explode('|', $_cache_id); $_cache_id_parts = explode('|', $_cache_id);

View File

@@ -84,7 +84,7 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase
$this->template->block_data[$_name]['source'] = ''; $this->template->block_data[$_name]['source'] = '';
// build {block} for child block // build {block} for child block
self::$block_data[$_name]['source'] = self::$block_data[$_name]['source'] =
"{$compiler->smarty->left_delimiter}private_child_block name={$_attr['name']} file='{$compiler->template->source->filepath}'" . "{$compiler->smarty->left_delimiter}private_child_block name={$_attr['name']} file='{$compiler->template->source->filepath}' type='{$compiler->template->source->type}' resource='{$compiler->template->template_resource}'" .
" uid='{$compiler->template->source->uid}' line={$compiler->lex->line}"; " uid='{$compiler->template->source->uid}' line={$compiler->lex->line}";
if ($_attr['nocache']) { if ($_attr['nocache']) {
self::$block_data[$_name]['source'] .= ' nocache'; self::$block_data[$_name]['source'] .= ' nocache';
@@ -361,7 +361,7 @@ class Smarty_Internal_Compile_Private_Child_Block extends Smarty_Internal_Compil
* @var array * @var array
* @see Smarty_Internal_CompileBase * @see Smarty_Internal_CompileBase
*/ */
public $required_attributes = array('name', 'file', 'uid', 'line'); public $required_attributes = array('name', 'file', 'uid', 'line', 'type', 'resource');
/** /**
@@ -377,7 +377,11 @@ class Smarty_Internal_Compile_Private_Child_Block extends Smarty_Internal_Compil
$_attr = $this->getAttributes($compiler, $args); $_attr = $this->getAttributes($compiler, $args);
// update template with original template resource of {block} // update template with original template resource of {block}
if (trim($_attr['type'], "'") == 'file') {
$compiler->template->template_resource = realpath(trim($_attr['file'], "'")); $compiler->template->template_resource = realpath(trim($_attr['file'], "'"));
} else {
$compiler->template->template_resource = trim($_attr['resource'], "'");
}
// source object // source object
unset ($compiler->template->source); unset ($compiler->template->source);
$exists = $compiler->template->source->exists; $exists = $compiler->template->source->exists;

View File

@@ -49,7 +49,6 @@ class Smarty_Internal_Compile_Foreach extends Smarty_Internal_CompileBase
*/ */
public function compile($args, $compiler, $parameter) public function compile($args, $compiler, $parameter)
{ {
$tpl = $compiler->template;
// check and get attributes // check and get attributes
$_attr = $this->getAttributes($compiler, $args); $_attr = $this->getAttributes($compiler, $args);
@@ -80,12 +79,12 @@ class Smarty_Internal_Compile_Foreach extends Smarty_Internal_CompileBase
$ItemVarName = '$' . trim($item, '\'"') . '@'; $ItemVarName = '$' . trim($item, '\'"') . '@';
// evaluates which Smarty variables and properties have to be computed // evaluates which Smarty variables and properties have to be computed
if ($has_name) { if ($has_name) {
$usesSmartyFirst = strpos($tpl->source->content, $SmartyVarName . 'first') !== false; $usesSmartyFirst = strpos($compiler->lex->data, $SmartyVarName . 'first') !== false;
$usesSmartyLast = strpos($tpl->source->content, $SmartyVarName . 'last') !== false; $usesSmartyLast = strpos($compiler->lex->data, $SmartyVarName . 'last') !== false;
$usesSmartyIndex = strpos($tpl->source->content, $SmartyVarName . 'index') !== false; $usesSmartyIndex = strpos($compiler->lex->data, $SmartyVarName . 'index') !== false;
$usesSmartyIteration = strpos($tpl->source->content, $SmartyVarName . 'iteration') !== false; $usesSmartyIteration = strpos($compiler->lex->data, $SmartyVarName . 'iteration') !== false;
$usesSmartyShow = strpos($tpl->source->content, $SmartyVarName . 'show') !== false; $usesSmartyShow = strpos($compiler->lex->data, $SmartyVarName . 'show') !== false;
$usesSmartyTotal = strpos($tpl->source->content, $SmartyVarName . 'total') !== false; $usesSmartyTotal = strpos($compiler->lex->data, $SmartyVarName . 'total') !== false;
} else { } else {
$usesSmartyFirst = false; $usesSmartyFirst = false;
$usesSmartyLast = false; $usesSmartyLast = false;
@@ -93,12 +92,12 @@ class Smarty_Internal_Compile_Foreach extends Smarty_Internal_CompileBase
$usesSmartyShow = false; $usesSmartyShow = false;
} }
$usesPropFirst = $usesSmartyFirst || strpos($tpl->source->content, $ItemVarName . 'first') !== false; $usesPropFirst = $usesSmartyFirst || strpos($compiler->lex->data, $ItemVarName . 'first') !== false;
$usesPropLast = $usesSmartyLast || strpos($tpl->source->content, $ItemVarName . 'last') !== false; $usesPropLast = $usesSmartyLast || strpos($compiler->lex->data, $ItemVarName . 'last') !== false;
$usesPropIndex = $usesPropFirst || strpos($tpl->source->content, $ItemVarName . 'index') !== false; $usesPropIndex = $usesPropFirst || strpos($compiler->lex->data, $ItemVarName . 'index') !== false;
$usesPropIteration = $usesPropLast || strpos($tpl->source->content, $ItemVarName . 'iteration') !== false; $usesPropIteration = $usesPropLast || strpos($compiler->lex->data, $ItemVarName . 'iteration') !== false;
$usesPropShow = strpos($tpl->source->content, $ItemVarName . 'show') !== false; $usesPropShow = strpos($compiler->lex->data, $ItemVarName . 'show') !== false;
$usesPropTotal = $usesSmartyTotal || $usesSmartyShow || $usesPropShow || $usesPropLast || strpos($tpl->source->content, $ItemVarName . 'total') !== false; $usesPropTotal = $usesSmartyTotal || $usesSmartyShow || $usesPropShow || $usesPropLast || strpos($compiler->lex->data, $ItemVarName . 'total') !== false;
// generate output code // generate output code
$output = "<?php "; $output = "<?php ";
$output .= " \$_smarty_tpl->tpl_vars[$item] = new Smarty_Variable; \$_smarty_tpl->tpl_vars[$item]->_loop = false;\n"; $output .= " \$_smarty_tpl->tpl_vars[$item] = new Smarty_Variable; \$_smarty_tpl->tpl_vars[$item]->_loop = false;\n";

View File

@@ -34,7 +34,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data
if ($template === null && $this instanceof $this->template_class) { if ($template === null && $this instanceof $this->template_class) {
$template = $this; $template = $this;
} }
if (!empty($cache_id) && is_object($cache_id)) { if ($cache_id !== null && is_object($cache_id)) {
$parent = $cache_id; $parent = $cache_id;
$cache_id = null; $cache_id = null;
} }

View File

@@ -1,12 +1,13 @@
<?php <?php
/** /**
* Smarty Internal Plugin Templatelexer * Smarty Internal Plugin Templatelexer
*
* This is the lexer to break the template source into tokens * This is the lexer to break the template source into tokens
*
* @package Smarty * @package Smarty
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Templatelexer * Smarty Internal Plugin Templatelexer
*/ */
@@ -76,7 +77,6 @@ class Smarty_Internal_Templatelexer
'TO' => 'to', 'TO' => 'to',
); );
function __construct($data, $compiler) function __construct($data, $compiler)
{ {
// $this->data = preg_replace("/(\r\n|\r|\n)/", "\n", $data); // $this->data = preg_replace("/(\r\n|\r|\n)/", "\n", $data);
@@ -100,7 +100,6 @@ class Smarty_Internal_Templatelexer
$this->yyTracePrompt = '<br>'; $this->yyTracePrompt = '<br>';
} }
private $_yy_state = 1; private $_yy_state = 1;
private $_yy_stack = array(); private $_yy_stack = array();
@@ -130,7 +129,6 @@ class Smarty_Internal_Templatelexer
if ($this->yyTraceFILE) { if ($this->yyTraceFILE) {
fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state);
} }
} }
public function yybegin($state) public function yybegin($state)
@@ -141,8 +139,6 @@ class Smarty_Internal_Templatelexer
} }
} }
public function yylex1() public function yylex1()
{ {
$tokenMap = array( $tokenMap = array(
@@ -206,59 +202,64 @@ class Smarty_Internal_Templatelexer
} }
// skip this token // skip this token
continue; continue;
} } else { }
} else {
throw new Exception('Unexpected input at line' . $this->line . throw new Exception('Unexpected input at line' . $this->line .
': ' . $this->data[$this->counter]); ': ' . $this->data[$this->counter]);
} }
break; break;
} while (true); } while (true);
} // end function } // end function
const TEXT = 1; const TEXT = 1;
function yy_r1_1($yy_subpatterns) function yy_r1_1($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} }
function yy_r1_2($yy_subpatterns) function yy_r1_2($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_COMMENT; $this->token = Smarty_Internal_Templateparser::TP_COMMENT;
} }
function yy_r1_4($yy_subpatterns) function yy_r1_4($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_STRIPON; $this->token = Smarty_Internal_Templateparser::TP_STRIPON;
} }
} }
function yy_r1_5($yy_subpatterns) function yy_r1_5($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_STRIPOFF; $this->token = Smarty_Internal_Templateparser::TP_STRIPOFF;
} }
} }
function yy_r1_6($yy_subpatterns) function yy_r1_6($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_LITERALSTART; $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART;
$this->yypushstate(self::LITERAL); $this->yypushstate(self::LITERAL);
} }
} }
function yy_r1_7($yy_subpatterns) function yy_r1_7($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_LDELIF; $this->token = Smarty_Internal_Templateparser::TP_LDELIF;
@@ -266,10 +267,11 @@ class Smarty_Internal_Templatelexer
$this->taglineno = $this->line; $this->taglineno = $this->line;
} }
} }
function yy_r1_9($yy_subpatterns) function yy_r1_9($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_LDELFOR; $this->token = Smarty_Internal_Templateparser::TP_LDELFOR;
@@ -277,10 +279,11 @@ class Smarty_Internal_Templatelexer
$this->taglineno = $this->line; $this->taglineno = $this->line;
} }
} }
function yy_r1_10($yy_subpatterns) function yy_r1_10($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH; $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;
@@ -288,10 +291,11 @@ class Smarty_Internal_Templatelexer
$this->taglineno = $this->line; $this->taglineno = $this->line;
} }
} }
function yy_r1_11($yy_subpatterns) function yy_r1_11($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_LDELSETFILTER; $this->token = Smarty_Internal_Templateparser::TP_LDELSETFILTER;
@@ -299,10 +303,11 @@ class Smarty_Internal_Templatelexer
$this->taglineno = $this->line; $this->taglineno = $this->line;
} }
} }
function yy_r1_12($yy_subpatterns) function yy_r1_12($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
@@ -310,10 +315,11 @@ class Smarty_Internal_Templatelexer
$this->taglineno = $this->line; $this->taglineno = $this->line;
} }
} }
function yy_r1_13($yy_subpatterns) function yy_r1_13($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_LDEL; $this->token = Smarty_Internal_Templateparser::TP_LDEL;
@@ -321,6 +327,7 @@ class Smarty_Internal_Templatelexer
$this->taglineno = $this->line; $this->taglineno = $this->line;
} }
} }
function yy_r1_14($yy_subpatterns) function yy_r1_14($yy_subpatterns)
{ {
@@ -333,26 +340,31 @@ class Smarty_Internal_Templatelexer
$this->value = substr($this->value, 0, 2); $this->value = substr($this->value, 0, 2);
} }
} }
function yy_r1_15($yy_subpatterns) function yy_r1_15($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_PHPENDTAG; $this->token = Smarty_Internal_Templateparser::TP_PHPENDTAG;
} }
function yy_r1_16($yy_subpatterns) function yy_r1_16($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} }
function yy_r1_17($yy_subpatterns) function yy_r1_17($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_ASPSTARTTAG; $this->token = Smarty_Internal_Templateparser::TP_ASPSTARTTAG;
} }
function yy_r1_18($yy_subpatterns) function yy_r1_18($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_ASPENDTAG; $this->token = Smarty_Internal_Templateparser::TP_ASPENDTAG;
} }
function yy_r1_19($yy_subpatterns) function yy_r1_19($yy_subpatterns)
{ {
@@ -373,7 +385,6 @@ class Smarty_Internal_Templatelexer
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} }
public function yylex2() public function yylex2()
{ {
$tokenMap = array( $tokenMap = array(
@@ -486,250 +497,296 @@ class Smarty_Internal_Templatelexer
} }
// skip this token // skip this token
continue; continue;
} } else { }
} else {
throw new Exception('Unexpected input at line' . $this->line . throw new Exception('Unexpected input at line' . $this->line .
': ' . $this->data[$this->counter]); ': ' . $this->data[$this->counter]);
} }
break; break;
} while (true); } while (true);
} // end function } // end function
const SMARTY = 2; const SMARTY = 2;
function yy_r2_1($yy_subpatterns) function yy_r2_1($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_QUOTE; $this->token = Smarty_Internal_Templateparser::TP_QUOTE;
$this->yypushstate(self::DOUBLEQUOTEDSTRING); $this->yypushstate(self::DOUBLEQUOTEDSTRING);
} }
function yy_r2_2($yy_subpatterns) function yy_r2_2($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_SINGLEQUOTESTRING; $this->token = Smarty_Internal_Templateparser::TP_SINGLEQUOTESTRING;
} }
function yy_r2_3($yy_subpatterns) function yy_r2_3($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILDPARENT; $this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILDPARENT;
$this->taglineno = $this->line; $this->taglineno = $this->line;
} }
function yy_r2_5($yy_subpatterns) function yy_r2_5($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_DOLLAR; $this->token = Smarty_Internal_Templateparser::TP_DOLLAR;
} }
function yy_r2_6($yy_subpatterns) function yy_r2_6($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_RDEL; $this->token = Smarty_Internal_Templateparser::TP_RDEL;
$this->yypopstate(); $this->yypopstate();
} }
function yy_r2_7($yy_subpatterns) function yy_r2_7($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_ISIN; $this->token = Smarty_Internal_Templateparser::TP_ISIN;
} }
function yy_r2_8($yy_subpatterns) function yy_r2_8($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_AS; $this->token = Smarty_Internal_Templateparser::TP_AS;
} }
function yy_r2_9($yy_subpatterns) function yy_r2_9($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_TO; $this->token = Smarty_Internal_Templateparser::TP_TO;
} }
function yy_r2_10($yy_subpatterns) function yy_r2_10($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_STEP; $this->token = Smarty_Internal_Templateparser::TP_STEP;
} }
function yy_r2_11($yy_subpatterns) function yy_r2_11($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF; $this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF;
} }
function yy_r2_12($yy_subpatterns) function yy_r2_12($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_IDENTITY; $this->token = Smarty_Internal_Templateparser::TP_IDENTITY;
} }
function yy_r2_13($yy_subpatterns) function yy_r2_13($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_NONEIDENTITY; $this->token = Smarty_Internal_Templateparser::TP_NONEIDENTITY;
} }
function yy_r2_14($yy_subpatterns) function yy_r2_14($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_EQUALS; $this->token = Smarty_Internal_Templateparser::TP_EQUALS;
} }
function yy_r2_15($yy_subpatterns) function yy_r2_15($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_NOTEQUALS; $this->token = Smarty_Internal_Templateparser::TP_NOTEQUALS;
} }
function yy_r2_17($yy_subpatterns) function yy_r2_17($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_GREATEREQUAL; $this->token = Smarty_Internal_Templateparser::TP_GREATEREQUAL;
} }
function yy_r2_19($yy_subpatterns) function yy_r2_19($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_LESSEQUAL; $this->token = Smarty_Internal_Templateparser::TP_LESSEQUAL;
} }
function yy_r2_21($yy_subpatterns) function yy_r2_21($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_GREATERTHAN; $this->token = Smarty_Internal_Templateparser::TP_GREATERTHAN;
} }
function yy_r2_22($yy_subpatterns) function yy_r2_22($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_LESSTHAN; $this->token = Smarty_Internal_Templateparser::TP_LESSTHAN;
} }
function yy_r2_23($yy_subpatterns) function yy_r2_23($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_MOD; $this->token = Smarty_Internal_Templateparser::TP_MOD;
} }
function yy_r2_24($yy_subpatterns) function yy_r2_24($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_NOT; $this->token = Smarty_Internal_Templateparser::TP_NOT;
} }
function yy_r2_25($yy_subpatterns) function yy_r2_25($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_LAND; $this->token = Smarty_Internal_Templateparser::TP_LAND;
} }
function yy_r2_26($yy_subpatterns) function yy_r2_26($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_LOR; $this->token = Smarty_Internal_Templateparser::TP_LOR;
} }
function yy_r2_27($yy_subpatterns) function yy_r2_27($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_LXOR; $this->token = Smarty_Internal_Templateparser::TP_LXOR;
} }
function yy_r2_28($yy_subpatterns) function yy_r2_28($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_ISODDBY; $this->token = Smarty_Internal_Templateparser::TP_ISODDBY;
} }
function yy_r2_29($yy_subpatterns) function yy_r2_29($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_ISNOTODDBY; $this->token = Smarty_Internal_Templateparser::TP_ISNOTODDBY;
} }
function yy_r2_30($yy_subpatterns) function yy_r2_30($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_ISODD; $this->token = Smarty_Internal_Templateparser::TP_ISODD;
} }
function yy_r2_31($yy_subpatterns) function yy_r2_31($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_ISNOTODD; $this->token = Smarty_Internal_Templateparser::TP_ISNOTODD;
} }
function yy_r2_32($yy_subpatterns) function yy_r2_32($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_ISEVENBY; $this->token = Smarty_Internal_Templateparser::TP_ISEVENBY;
} }
function yy_r2_33($yy_subpatterns) function yy_r2_33($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_ISNOTEVENBY; $this->token = Smarty_Internal_Templateparser::TP_ISNOTEVENBY;
} }
function yy_r2_34($yy_subpatterns) function yy_r2_34($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_ISEVEN; $this->token = Smarty_Internal_Templateparser::TP_ISEVEN;
} }
function yy_r2_35($yy_subpatterns) function yy_r2_35($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_ISNOTEVEN; $this->token = Smarty_Internal_Templateparser::TP_ISNOTEVEN;
} }
function yy_r2_36($yy_subpatterns) function yy_r2_36($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_ISDIVBY; $this->token = Smarty_Internal_Templateparser::TP_ISDIVBY;
} }
function yy_r2_37($yy_subpatterns) function yy_r2_37($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_ISNOTDIVBY; $this->token = Smarty_Internal_Templateparser::TP_ISNOTDIVBY;
} }
function yy_r2_38($yy_subpatterns) function yy_r2_38($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_TYPECAST; $this->token = Smarty_Internal_Templateparser::TP_TYPECAST;
} }
function yy_r2_42($yy_subpatterns) function yy_r2_42($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_OPENP; $this->token = Smarty_Internal_Templateparser::TP_OPENP;
} }
function yy_r2_43($yy_subpatterns) function yy_r2_43($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_CLOSEP; $this->token = Smarty_Internal_Templateparser::TP_CLOSEP;
} }
function yy_r2_44($yy_subpatterns) function yy_r2_44($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_OPENB; $this->token = Smarty_Internal_Templateparser::TP_OPENB;
} }
function yy_r2_45($yy_subpatterns) function yy_r2_45($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_CLOSEB; $this->token = Smarty_Internal_Templateparser::TP_CLOSEB;
} }
function yy_r2_46($yy_subpatterns) function yy_r2_46($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_PTR; $this->token = Smarty_Internal_Templateparser::TP_PTR;
} }
function yy_r2_47($yy_subpatterns) function yy_r2_47($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_APTR; $this->token = Smarty_Internal_Templateparser::TP_APTR;
} }
function yy_r2_48($yy_subpatterns) function yy_r2_48($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_EQUAL; $this->token = Smarty_Internal_Templateparser::TP_EQUAL;
} }
function yy_r2_49($yy_subpatterns) function yy_r2_49($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_INCDEC; $this->token = Smarty_Internal_Templateparser::TP_INCDEC;
} }
function yy_r2_50($yy_subpatterns) function yy_r2_50($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_UNIMATH; $this->token = Smarty_Internal_Templateparser::TP_UNIMATH;
} }
function yy_r2_52($yy_subpatterns) function yy_r2_52($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_MATH; $this->token = Smarty_Internal_Templateparser::TP_MATH;
} }
function yy_r2_54($yy_subpatterns) function yy_r2_54($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_AT; $this->token = Smarty_Internal_Templateparser::TP_AT;
} }
function yy_r2_55($yy_subpatterns) function yy_r2_55($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_HATCH; $this->token = Smarty_Internal_Templateparser::TP_HATCH;
} }
function yy_r2_56($yy_subpatterns) function yy_r2_56($yy_subpatterns)
{ {
@@ -742,76 +799,90 @@ class Smarty_Internal_Templatelexer
$this->token = Smarty_Internal_Templateparser::TP_ATTR; $this->token = Smarty_Internal_Templateparser::TP_ATTR;
} }
} }
function yy_r2_57($yy_subpatterns) function yy_r2_57($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_ID; $this->token = Smarty_Internal_Templateparser::TP_ID;
} }
function yy_r2_58($yy_subpatterns) function yy_r2_58($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_INTEGER; $this->token = Smarty_Internal_Templateparser::TP_INTEGER;
} }
function yy_r2_59($yy_subpatterns) function yy_r2_59($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_BACKTICK; $this->token = Smarty_Internal_Templateparser::TP_BACKTICK;
$this->yypopstate(); $this->yypopstate();
} }
function yy_r2_60($yy_subpatterns) function yy_r2_60($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_VERT; $this->token = Smarty_Internal_Templateparser::TP_VERT;
} }
function yy_r2_61($yy_subpatterns) function yy_r2_61($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_DOT; $this->token = Smarty_Internal_Templateparser::TP_DOT;
} }
function yy_r2_62($yy_subpatterns) function yy_r2_62($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_COMMA; $this->token = Smarty_Internal_Templateparser::TP_COMMA;
} }
function yy_r2_63($yy_subpatterns) function yy_r2_63($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_SEMICOLON; $this->token = Smarty_Internal_Templateparser::TP_SEMICOLON;
} }
function yy_r2_64($yy_subpatterns) function yy_r2_64($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_DOUBLECOLON; $this->token = Smarty_Internal_Templateparser::TP_DOUBLECOLON;
} }
function yy_r2_65($yy_subpatterns) function yy_r2_65($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_COLON; $this->token = Smarty_Internal_Templateparser::TP_COLON;
} }
function yy_r2_66($yy_subpatterns) function yy_r2_66($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_ANDSYM; $this->token = Smarty_Internal_Templateparser::TP_ANDSYM;
} }
function yy_r2_67($yy_subpatterns) function yy_r2_67($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_QMARK; $this->token = Smarty_Internal_Templateparser::TP_QMARK;
} }
function yy_r2_68($yy_subpatterns) function yy_r2_68($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_HEX; $this->token = Smarty_Internal_Templateparser::TP_HEX;
} }
function yy_r2_69($yy_subpatterns) function yy_r2_69($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_SPACE; $this->token = Smarty_Internal_Templateparser::TP_SPACE;
} }
function yy_r2_70($yy_subpatterns) function yy_r2_70($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_LDELIF; $this->token = Smarty_Internal_Templateparser::TP_LDELIF;
@@ -819,10 +890,11 @@ class Smarty_Internal_Templatelexer
$this->taglineno = $this->line; $this->taglineno = $this->line;
} }
} }
function yy_r2_72($yy_subpatterns) function yy_r2_72($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_LDELFOR; $this->token = Smarty_Internal_Templateparser::TP_LDELFOR;
@@ -830,10 +902,11 @@ class Smarty_Internal_Templatelexer
$this->taglineno = $this->line; $this->taglineno = $this->line;
} }
} }
function yy_r2_73($yy_subpatterns) function yy_r2_73($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH; $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;
@@ -841,10 +914,11 @@ class Smarty_Internal_Templatelexer
$this->taglineno = $this->line; $this->taglineno = $this->line;
} }
} }
function yy_r2_74($yy_subpatterns) function yy_r2_74($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
@@ -852,10 +926,11 @@ class Smarty_Internal_Templatelexer
$this->taglineno = $this->line; $this->taglineno = $this->line;
} }
} }
function yy_r2_75($yy_subpatterns) function yy_r2_75($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_LDEL; $this->token = Smarty_Internal_Templateparser::TP_LDEL;
@@ -863,14 +938,13 @@ class Smarty_Internal_Templatelexer
$this->taglineno = $this->line; $this->taglineno = $this->line;
} }
} }
function yy_r2_76($yy_subpatterns) function yy_r2_76($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} }
public function yylex3() public function yylex3()
{ {
$tokenMap = array( $tokenMap = array(
@@ -924,37 +998,39 @@ class Smarty_Internal_Templatelexer
} }
// skip this token // skip this token
continue; continue;
} } else { }
} else {
throw new Exception('Unexpected input at line' . $this->line . throw new Exception('Unexpected input at line' . $this->line .
': ' . $this->data[$this->counter]); ': ' . $this->data[$this->counter]);
} }
break; break;
} while (true); } while (true);
} // end function } // end function
const LITERAL = 3; const LITERAL = 3;
function yy_r3_1($yy_subpatterns) function yy_r3_1($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_LITERALSTART; $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART;
$this->yypushstate(self::LITERAL); $this->yypushstate(self::LITERAL);
} }
} }
function yy_r3_2($yy_subpatterns) function yy_r3_2($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_LITERALEND; $this->token = Smarty_Internal_Templateparser::TP_LITERALEND;
$this->yypopstate(); $this->yypopstate();
} }
} }
function yy_r3_3($yy_subpatterns) function yy_r3_3($yy_subpatterns)
{ {
@@ -965,21 +1041,25 @@ class Smarty_Internal_Templatelexer
$this->value = substr($this->value, 0, 2); $this->value = substr($this->value, 0, 2);
} }
} }
function yy_r3_4($yy_subpatterns) function yy_r3_4($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_PHPENDTAG; $this->token = Smarty_Internal_Templateparser::TP_PHPENDTAG;
} }
function yy_r3_5($yy_subpatterns) function yy_r3_5($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_ASPSTARTTAG; $this->token = Smarty_Internal_Templateparser::TP_ASPSTARTTAG;
} }
function yy_r3_6($yy_subpatterns) function yy_r3_6($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_ASPENDTAG; $this->token = Smarty_Internal_Templateparser::TP_ASPENDTAG;
} }
function yy_r3_7($yy_subpatterns) function yy_r3_7($yy_subpatterns)
{ {
@@ -1002,7 +1082,6 @@ class Smarty_Internal_Templatelexer
$this->token = Smarty_Internal_Templateparser::TP_LITERAL; $this->token = Smarty_Internal_Templateparser::TP_LITERAL;
} }
public function yylex4() public function yylex4()
{ {
$tokenMap = array( $tokenMap = array(
@@ -1060,21 +1139,21 @@ class Smarty_Internal_Templatelexer
} }
// skip this token // skip this token
continue; continue;
} } else { }
} else {
throw new Exception('Unexpected input at line' . $this->line . throw new Exception('Unexpected input at line' . $this->line .
': ' . $this->data[$this->counter]); ': ' . $this->data[$this->counter]);
} }
break; break;
} while (true); } while (true);
} // end function } // end function
const DOUBLEQUOTEDSTRING = 4; const DOUBLEQUOTEDSTRING = 4;
function yy_r4_1($yy_subpatterns) function yy_r4_1($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_LDELIF; $this->token = Smarty_Internal_Templateparser::TP_LDELIF;
@@ -1082,10 +1161,11 @@ class Smarty_Internal_Templatelexer
$this->taglineno = $this->line; $this->taglineno = $this->line;
} }
} }
function yy_r4_3($yy_subpatterns) function yy_r4_3($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_LDELFOR; $this->token = Smarty_Internal_Templateparser::TP_LDELFOR;
@@ -1093,10 +1173,11 @@ class Smarty_Internal_Templatelexer
$this->taglineno = $this->line; $this->taglineno = $this->line;
} }
} }
function yy_r4_4($yy_subpatterns) function yy_r4_4($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH; $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;
@@ -1104,10 +1185,11 @@ class Smarty_Internal_Templatelexer
$this->taglineno = $this->line; $this->taglineno = $this->line;
} }
} }
function yy_r4_5($yy_subpatterns) function yy_r4_5($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
@@ -1115,10 +1197,11 @@ class Smarty_Internal_Templatelexer
$this->taglineno = $this->line; $this->taglineno = $this->line;
} }
} }
function yy_r4_6($yy_subpatterns) function yy_r4_6($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_LDEL; $this->token = Smarty_Internal_Templateparser::TP_LDEL;
@@ -1126,12 +1209,14 @@ class Smarty_Internal_Templatelexer
$this->taglineno = $this->line; $this->taglineno = $this->line;
} }
} }
function yy_r4_7($yy_subpatterns) function yy_r4_7($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_QUOTE; $this->token = Smarty_Internal_Templateparser::TP_QUOTE;
$this->yypopstate(); $this->yypopstate();
} }
function yy_r4_8($yy_subpatterns) function yy_r4_8($yy_subpatterns)
{ {
@@ -1140,21 +1225,25 @@ class Smarty_Internal_Templatelexer
$this->yypushstate(self::SMARTY); $this->yypushstate(self::SMARTY);
$this->taglineno = $this->line; $this->taglineno = $this->line;
} }
function yy_r4_9($yy_subpatterns) function yy_r4_9($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_DOLLARID; $this->token = Smarty_Internal_Templateparser::TP_DOLLARID;
} }
function yy_r4_10($yy_subpatterns) function yy_r4_10($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} }
function yy_r4_11($yy_subpatterns) function yy_r4_11($yy_subpatterns)
{ {
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} }
function yy_r4_15($yy_subpatterns) function yy_r4_15($yy_subpatterns)
{ {
@@ -1171,7 +1260,6 @@ class Smarty_Internal_Templatelexer
$this->token = Smarty_Internal_Templateparser::TP_TEXT; $this->token = Smarty_Internal_Templateparser::TP_TEXT;
} }
public function yylex5() public function yylex5()
{ {
$tokenMap = array( $tokenMap = array(
@@ -1222,45 +1310,48 @@ class Smarty_Internal_Templatelexer
} }
// skip this token // skip this token
continue; continue;
} } else { }
} else {
throw new Exception('Unexpected input at line' . $this->line . throw new Exception('Unexpected input at line' . $this->line .
': ' . $this->data[$this->counter]); ': ' . $this->data[$this->counter]);
} }
break; break;
} while (true); } while (true);
} // end function } // end function
const CHILDBODY = 5; const CHILDBODY = 5;
function yy_r5_1($yy_subpatterns) function yy_r5_1($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
return false; return false;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_STRIPON; $this->token = Smarty_Internal_Templateparser::TP_STRIPON;
} }
} }
function yy_r5_2($yy_subpatterns) function yy_r5_2($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
return false; return false;
} else { } else {
$this->token = Smarty_Internal_Templateparser::TP_STRIPOFF; $this->token = Smarty_Internal_Templateparser::TP_STRIPOFF;
} }
} }
function yy_r5_3($yy_subpatterns) function yy_r5_3($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
return false; return false;
} else { } else {
$this->yypopstate(); $this->yypopstate();
return true; return true;
} }
} }
function yy_r5_4($yy_subpatterns) function yy_r5_4($yy_subpatterns)
{ {
@@ -1281,7 +1372,6 @@ class Smarty_Internal_Templatelexer
return false; return false;
} }
public function yylex6() public function yylex6()
{ {
$tokenMap = array( $tokenMap = array(
@@ -1332,47 +1422,50 @@ class Smarty_Internal_Templatelexer
} }
// skip this token // skip this token
continue; continue;
} } else { }
} else {
throw new Exception('Unexpected input at line' . $this->line . throw new Exception('Unexpected input at line' . $this->line .
': ' . $this->data[$this->counter]); ': ' . $this->data[$this->counter]);
} }
break; break;
} while (true); } while (true);
} // end function } // end function
const CHILDBLOCK = 6; const CHILDBLOCK = 6;
function yy_r6_1($yy_subpatterns) function yy_r6_1($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE; $this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE;
} else { } else {
$this->yypopstate(); $this->yypopstate();
return true; return true;
} }
} }
function yy_r6_2($yy_subpatterns) function yy_r6_2($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE; $this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE;
} else { } else {
$this->yypopstate(); $this->yypopstate();
return true; return true;
} }
} }
function yy_r6_3($yy_subpatterns) function yy_r6_3($yy_subpatterns)
{ {
if ($this->smarty->auto_literal && ($this->mbstring_overload ? (mb_strpos(" \n\t\r",mb_substr($this->value,$this->ldel_length,1,'latin1'),0,'latin1') !== false) : (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false))) { if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE; $this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE;
} else { } else {
$this->yypopstate(); $this->yypopstate();
return true; return true;
} }
} }
function yy_r6_5($yy_subpatterns) function yy_r6_5($yy_subpatterns)
{ {
@@ -1392,5 +1485,4 @@ class Smarty_Internal_Templatelexer
} }
$this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE; $this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE;
} }
} }

View File

@@ -182,9 +182,9 @@ class Smarty_Internal_Utility
*/ */
public static function clearCompiledTemplate($resource_name, $compile_id, $exp_time, Smarty $smarty) public static function clearCompiledTemplate($resource_name, $compile_id, $exp_time, Smarty $smarty)
{ {
$_compile_dir = realpath($smarty->getCompileDir()); $_compile_dir = realpath($smarty->getCompileDir()).'/';
$_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null; $_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null;
$_dir_sep = $smarty->use_sub_dirs ? DS : '^'; $_dir_sep = $smarty->use_sub_dirs ? '/' : '^';
if (isset($resource_name)) { if (isset($resource_name)) {
$_save_stat = $smarty->caching; $_save_stat = $smarty->caching;
$smarty->caching = false; $smarty->caching = false;
@@ -218,7 +218,7 @@ class Smarty_Internal_Utility
$_dir .= $_compile_id . $_dir_sep; $_dir .= $_compile_id . $_dir_sep;
} }
if (isset($_compile_id)) { if (isset($_compile_id)) {
$_compile_id_part = $_compile_dir . $_compile_id . $_dir_sep; $_compile_id_part = str_replace('\\','/',$_compile_dir . $_compile_id . $_dir_sep);
$_compile_id_part_length = strlen($_compile_id_part); $_compile_id_part_length = strlen($_compile_id_part);
} }
$_count = 0; $_count = 0;
@@ -233,7 +233,7 @@ class Smarty_Internal_Utility
if (substr(basename($_file->getPathname()), 0, 1) == '.' || strpos($_file, '.svn') !== false) if (substr(basename($_file->getPathname()), 0, 1) == '.' || strpos($_file, '.svn') !== false)
continue; continue;
$_filepath = (string) $_file; $_filepath = str_replace('\\','/',(string) $_file);
if ($_file->isDir()) { if ($_file->isDir()) {
if (!$_compile->isDot()) { if (!$_compile->isDot()) {
@@ -242,7 +242,7 @@ class Smarty_Internal_Utility
} }
} else { } else {
$unlink = false; $unlink = false;
if ((!isset($_compile_id) || (isset($_filepath[$_compile_id_part_length]) && !strncmp($_filepath, $_compile_id_part, $_compile_id_part_length))) if ((!isset($_compile_id) || (isset($_filepath[$_compile_id_part_length]) && $a = !strncmp($_filepath, $_compile_id_part, $_compile_id_part_length)))
&& (!isset($resource_name) && (!isset($resource_name)
|| (isset($_filepath[$_resource_part_1_length]) || (isset($_filepath[$_resource_part_1_length])
&& substr_compare($_filepath, $_resource_part_1, -$_resource_part_1_length, $_resource_part_1_length) == 0) && substr_compare($_filepath, $_resource_part_1, -$_resource_part_1_length, $_resource_part_1_length) == 0)

View File

@@ -48,7 +48,7 @@ abstract class Smarty_Resource_Custom extends Smarty_Resource
*/ */
public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null) public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
{ {
$source->filepath = strtolower($source->type . ':' . $source->name); $source->filepath = $source->type . ':' . $source->name;
$source->uid = sha1($source->type . ':' . $source->name); $source->uid = sha1($source->type . ':' . $source->name);
$mtime = $this->fetchTimestamp($source->name); $mtime = $this->fetchTimestamp($source->name);