From a5961606f3bb76d0fe8b68da8c106f3a40cbd876 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Fri, 16 Mar 2018 18:44:47 +0100 Subject: [PATCH 01/31] - bugfix extends resource did not work with user defined left/right delimiter https://github.com/smarty-php/smarty/issues/419 --- change_log.txt | 3 +++ libs/Smarty.class.php | 5 ++++- libs/sysplugins/smarty_internal_compile_extends.php | 9 +++++---- libs/sysplugins/smarty_internal_templatecompilerbase.php | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/change_log.txt b/change_log.txt index 81f6f0ef..112bd259 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== 3.1.32 - dev === +16.03.2018 + - bugfix extends resource did not work with user defined left/right delimiter https://github.com/smarty-php/smarty/issues/419 + 22.11.2017 - bugfix {break} and {continue} could fail if {foreach}{/foreach} did contain other looping tags like {for}, {section} and {while} https://github.com/smarty-php/smarty/issues/323 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 3e84d0ec..c9b2bb66 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.32-dev-38'; + const SMARTY_VERSION = '3.1.32-dev-39'; /** * define variable scopes */ @@ -1270,6 +1270,7 @@ class Smarty extends Smarty_Internal_TemplateBase * @param string $name property name * * @return mixed + * @throws \SmartyException */ public function __get($name) { @@ -1293,6 +1294,8 @@ class Smarty extends Smarty_Internal_TemplateBase * * @param string $name property name * @param mixed $value parameter passed to setter + * + * @throws \SmartyException */ public function __set($name, $value) { diff --git a/libs/sysplugins/smarty_internal_compile_extends.php b/libs/sysplugins/smarty_internal_compile_extends.php index 58416661..37bf8dd3 100644 --- a/libs/sysplugins/smarty_internal_compile_extends.php +++ b/libs/sysplugins/smarty_internal_compile_extends.php @@ -135,16 +135,17 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_Compile_Shared_Inh /** * Create source code for {extends} from source components array * - * @param []\Smarty_Internal_Template_Source $components + * @param \Smarty_Internal_Template $template * * @return string */ - public static function extendsSourceArrayCode($components) + public static function extendsSourceArrayCode(Smarty_Internal_Template $template) { $resources = array(); - foreach ($components as $source) { + foreach ($template->source->components as $source) { $resources[] = $source->resource; } - return '{extends file=\'extends:' . join('|', $resources) . '\' extends_resource=true}'; + return $template->smarty->left_delimiter . 'extends file=\'extends:' . join('|', $resources) . + '\' extends_resource=true' . $template->smarty->right_delimiter; } } diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index ed2edf97..d4b0fab4 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -394,7 +394,7 @@ abstract class Smarty_Internal_TemplateCompilerBase // we have array of inheritance templates by extends: resource // generate corresponding source code sequence $_content = - Smarty_Internal_Compile_Extends::extendsSourceArrayCode($this->template->source->components); + Smarty_Internal_Compile_Extends::extendsSourceArrayCode($this->template); } else { // get template source $_content = $this->template->source->getContent(); From 60415e6f2a5f7a16a16100118ce0d4d128b94f27 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Sat, 17 Mar 2018 08:31:40 +0100 Subject: [PATCH 02/31] - improvement Smarty::compileAllTemplates() exit with a non-zero status code if max errors is reached https://github.com/smarty-php/smarty/pull/402 --- change_log.txt | 3 +++ libs/Smarty.class.php | 2 +- libs/sysplugins/smarty_internal_method_compilealltemplates.php | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/change_log.txt b/change_log.txt index 112bd259..1c19c53b 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== 3.1.32 - dev === +17.03.2018 + - improvement Smarty::compileAllTemplates() exit with a non-zero status code if max errors is reached https://github.com/smarty-php/smarty/pull/402 + 16.03.2018 - bugfix extends resource did not work with user defined left/right delimiter https://github.com/smarty-php/smarty/issues/419 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index c9b2bb66..c52c486e 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.32-dev-39'; + const SMARTY_VERSION = '3.1.32-dev-40'; /** * define variable scopes */ diff --git a/libs/sysplugins/smarty_internal_method_compilealltemplates.php b/libs/sysplugins/smarty_internal_method_compilealltemplates.php index 99b9df46..64912599 100644 --- a/libs/sysplugins/smarty_internal_method_compilealltemplates.php +++ b/libs/sysplugins/smarty_internal_method_compilealltemplates.php @@ -115,7 +115,7 @@ class Smarty_Internal_Method_CompileAllTemplates $_smarty->_clearTemplateCache(); if ($max_errors !== null && $_error_count === $max_errors) { echo "\n

too many errors\n"; - exit(); + exit(1); } } } From b7e7def0b1b8636c502d0661a672b5d777fb080a Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Wed, 21 Mar 2018 07:36:11 +0100 Subject: [PATCH 03/31] - bugfix {$smarty.section...} used outside {section}{/section} showed incorrect values if {section}{/section} was called inside another loop https://github.com/smarty-php/smarty/issues/422 --- change_log.txt | 4 ++++ libs/Smarty.class.php | 2 +- libs/sysplugins/smarty_internal_compile_section.php | 6 +----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/change_log.txt b/change_log.txt index 1c19c53b..c72abc8d 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,8 @@ ===== 3.1.32 - dev === +21.03.2018 + - bugfix {$smarty.section...} used outside {section}{/section} showed incorrect values if {section}{/section} was called inside + another loop https://github.com/smarty-php/smarty/issues/422 + 17.03.2018 - improvement Smarty::compileAllTemplates() exit with a non-zero status code if max errors is reached https://github.com/smarty-php/smarty/pull/402 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index c52c486e..1c6eefeb 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.32-dev-40'; + const SMARTY_VERSION = '3.1.32-dev-41'; /** * define variable scopes */ diff --git a/libs/sysplugins/smarty_internal_compile_section.php b/libs/sysplugins/smarty_internal_compile_section.php index 8b4f5034..6e80e0fd 100644 --- a/libs/sysplugins/smarty_internal_compile_section.php +++ b/libs/sysplugins/smarty_internal_compile_section.php @@ -104,8 +104,7 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo // maybe nocache because of nocache variables $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; - $initLocal = - array('saved' => "isset(\$_smarty_tpl->tpl_vars['__smarty_section_{$attributes['name']}']) ? \$_smarty_tpl->tpl_vars['__smarty_section_{$attributes['name']}'] : false",); + $initLocal = array(); $initNamedProperty = array(); $initFor = array(); $incFor = array(); @@ -455,9 +454,6 @@ class Smarty_Internal_Compile_Sectionclose extends Smarty_Internal_CompileBase } else { $output .= "}\n}\n"; } - $output .= "if ({$local}saved) {\n"; - $output .= "{$sectionVar} = {$local}saved;\n"; - $output .= "}\n"; $output .= '?>'; return $output; From d79af55485aa3366202953086b62989ab7bd2f39 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Wed, 21 Mar 2018 15:19:57 +0100 Subject: [PATCH 04/31] - bugfix short form of {section} attributes did not work https://github.com/smarty-php/smarty/issues/428 --- change_log.txt | 1 + libs/Smarty.class.php | 2 +- .../smarty_internal_compile_private_foreachsection.php | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/change_log.txt b/change_log.txt index c72abc8d..e0df0c3d 100644 --- a/change_log.txt +++ b/change_log.txt @@ -2,6 +2,7 @@ 21.03.2018 - bugfix {$smarty.section...} used outside {section}{/section} showed incorrect values if {section}{/section} was called inside another loop https://github.com/smarty-php/smarty/issues/422 + - bugfix short form of {section} attributes did not work https://github.com/smarty-php/smarty/issues/428 17.03.2018 - improvement Smarty::compileAllTemplates() exit with a non-zero status code if max errors is reached https://github.com/smarty-php/smarty/pull/402 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 1c6eefeb..4e5ed1ee 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.32-dev-41'; + const SMARTY_VERSION = '3.1.32-dev-42'; /** * define variable scopes */ diff --git a/libs/sysplugins/smarty_internal_compile_private_foreachsection.php b/libs/sysplugins/smarty_internal_compile_private_foreachsection.php index 6a2ac07d..5161da64 100644 --- a/libs/sysplugins/smarty_internal_compile_private_foreachsection.php +++ b/libs/sysplugins/smarty_internal_compile_private_foreachsection.php @@ -112,8 +112,9 @@ class Smarty_Internal_Compile_Private_ForeachSection extends Smarty_Internal_Com public function buildPropertyPreg($named, $attributes) { if ($named) { - $this->resultOffsets[ 'named' ] = $this->startOffset + 3; - $this->propertyPreg .= "([\$]smarty[.]{$this->tagName}[.]{$attributes['name']}[.]("; + $this->resultOffsets[ 'named' ] = $this->startOffset + 4; + $this->propertyPreg .= "(([\$]smarty[.]{$this->tagName}[.]" . ($this->tagName === 'section' ? "|[\[]\s*" : '') + . "){$attributes['name']}[.]("; $properties = $this->nameProperties; } else { $this->resultOffsets[ 'item' ] = $this->startOffset + 3; From d646d4678cf4d6dbcb53d731f46e4aeb813cc3a5 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Fri, 23 Mar 2018 19:11:12 +0100 Subject: [PATCH 05/31] - bugfix preg_replace could fail on large content resulting in a blank page https://github.com/smarty-php/smarty/issues/417 --- change_log.txt | 3 + libs/Smarty.class.php | 2 +- .../smarty_internal_runtime_codeframe.php | 25 +++- .../smarty_internal_runtime_updatecache.php | 114 ++++++++++-------- 4 files changed, 89 insertions(+), 55 deletions(-) diff --git a/change_log.txt b/change_log.txt index e0df0c3d..bb7d084f 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== 3.1.32 - dev === +23.03.2018 + - bugfix preg_replace could fail on large content resulting in a blank page https://github.com/smarty-php/smarty/issues/417 + 21.03.2018 - bugfix {$smarty.section...} used outside {section}{/section} showed incorrect values if {section}{/section} was called inside another loop https://github.com/smarty-php/smarty/issues/422 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 4e5ed1ee..8563b439 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.32-dev-42'; + const SMARTY_VERSION = '3.1.32-dev-43'; /** * define variable scopes */ diff --git a/libs/sysplugins/smarty_internal_runtime_codeframe.php b/libs/sysplugins/smarty_internal_runtime_codeframe.php index 1833c11a..270f9a55 100644 --- a/libs/sysplugins/smarty_internal_runtime_codeframe.php +++ b/libs/sysplugins/smarty_internal_runtime_codeframe.php @@ -94,6 +94,29 @@ class Smarty_Internal_Runtime_CodeFrame $output .= $functions; $output .= "[\n]?<\?php\s*/', '/\?>\s*$/'), array("\n", ''), $output); + if (preg_match('/\s*\?>[\n]?<\?php\s*/', $output)) { + $curr_split = preg_split('/\s*\?>[\n]?<\?php\s*/', + $output); + var_dump($curr_split); + preg_match_all('/\s*\?>[\n]?<\?php\s*/', + $output, + $curr_parts); + $output = ''; + foreach ($curr_split as $idx => $curr_output) { + $output .= $curr_output; + if (isset($curr_parts[ 0 ][ $idx ])) { + $output .= "\n"; + } + } + } + if (preg_match('/\?>\s*$/', $output)) { + $curr_split = preg_split('/\?>\s*$/', + $output); + $output = ''; + foreach ($curr_split as $idx => $curr_output) { + $output .= $curr_output; + } + } + return $output; } } \ No newline at end of file diff --git a/libs/sysplugins/smarty_internal_runtime_updatecache.php b/libs/sysplugins/smarty_internal_runtime_updatecache.php index fbed94b3..1fc7bd3e 100644 --- a/libs/sysplugins/smarty_internal_runtime_updatecache.php +++ b/libs/sysplugins/smarty_internal_runtime_updatecache.php @@ -21,56 +21,6 @@ class Smarty_Internal_Runtime_UpdateCache { } - /** - * Sanitize content and write it to cache resource - * - * @param \Smarty_Template_Cached $cached - * @param Smarty_Internal_Template $_template - * @param bool $no_output_filter - * - * @throws \SmartyException - */ - public function removeNoCacheHash(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, - $no_output_filter) - { - $content = ob_get_clean(); - unset($cached->hashes[ $_template->compiled->nocache_hash ]); - if (!empty($cached->hashes)) { - $hash_array = array(); - foreach ($cached->hashes as $hash => $foo) { - $hash_array[] = "/{$hash}/"; - } - $content = preg_replace($hash_array, $_template->compiled->nocache_hash, $content); - } - $_template->cached->has_nocache_code = false; - // get text between non-cached items - $cache_split = - preg_split("!/\*%%SmartyNocache:{$_template->compiled->nocache_hash}%%\*\/(.+?)/\*/%%SmartyNocache:{$_template->compiled->nocache_hash}%%\*/!s", - $content); - // get non-cached items - preg_match_all("!/\*%%SmartyNocache:{$_template->compiled->nocache_hash}%%\*\/(.+?)/\*/%%SmartyNocache:{$_template->compiled->nocache_hash}%%\*/!s", - $content, $cache_parts); - $content = ''; - // loop over items, stitch back together - foreach ($cache_split as $curr_idx => $curr_split) { - // escape PHP tags in template content - $content .= preg_replace('/(<%|%>|<\?php|<\?|\?>|)/', - "\n", $curr_split); - if (isset($cache_parts[ 0 ][ $curr_idx ])) { - $_template->cached->has_nocache_code = true; - $content .= $cache_parts[ 1 ][ $curr_idx ]; - } - } - if (!$no_output_filter && !$_template->cached->has_nocache_code && - (isset($_template->smarty->autoload_filters[ 'output' ]) || - isset($_template->smarty->registered_filters[ 'output' ])) - ) { - $content = $_template->smarty->ext->_filterHandler->runFilter('output', $content, $_template); - } - // write cache file content - $this->writeCachedContent($cached, $_template, $content); - } - /** * Cache was invalid , so render from compiled and write to cache * @@ -106,6 +56,67 @@ class Smarty_Internal_Runtime_UpdateCache } } + /** + * Sanitize content and write it to cache resource + * + * @param \Smarty_Template_Cached $cached + * @param Smarty_Internal_Template $_template + * @param bool $no_output_filter + * + * @throws \SmartyException + */ + public function removeNoCacheHash(Smarty_Template_Cached $cached, + Smarty_Internal_Template $_template, + $no_output_filter) + { + $php_pattern = '/(<%|%>|<\?php|<\?|\?>|)/'; + $content = ob_get_clean(); + $hash_array = $cached->hashes; + $hash_array = array_keys($hash_array); + $nocache_hash = '(' . implode('|', $hash_array) . ')'; + $_template->cached->has_nocache_code = false; + // get text between non-cached items + $cache_split = + preg_split("!/\*%%SmartyNocache:{$nocache_hash}%%\*\/(.+?)/\*/%%SmartyNocache:{$nocache_hash}%%\*/!s", + $content); + // get non-cached items + preg_match_all("!/\*%%SmartyNocache:{$nocache_hash}%%\*\/(.+?)/\*/%%SmartyNocache:{$nocache_hash}%%\*/!s", + $content, + $cache_parts); + $content = ''; + // loop over items, stitch back together + foreach ($cache_split as $curr_idx => $curr_split) { + if (preg_match($php_pattern, $curr_split)) { + // escape PHP tags in template content + $php_split = preg_split($php_pattern, + $curr_split); + preg_match_all($php_pattern, + $curr_split, + $php_parts); + foreach ($php_split as $idx_php => $curr_php) { + $content .= $curr_php; + if (isset($php_parts[ 0 ][ $idx_php ])) { + $content .= "\n"; + } + } + } else { + $content .= $curr_split; + } + if (isset($cache_parts[ 0 ][ $curr_idx ])) { + $_template->cached->has_nocache_code = true; + $content .= $cache_parts[ 2 ][ $curr_idx ]; + } + } + if (!$no_output_filter && !$_template->cached->has_nocache_code && + (isset($_template->smarty->autoload_filters[ 'output' ]) || + isset($_template->smarty->registered_filters[ 'output' ])) + ) { + $content = $_template->smarty->ext->_filterHandler->runFilter('output', $content, $_template); + } + // write cache file content + $this->writeCachedContent($cached, $_template, $content); + } + /** * Writes the content to cache resource * @@ -148,7 +159,6 @@ class Smarty_Internal_Runtime_UpdateCache if ($_template->smarty->cache_locking) { $cached->handler->releaseLock($_template->smarty, $cached); } - return true; } $cached->content = null; @@ -157,8 +167,6 @@ class Smarty_Internal_Runtime_UpdateCache $cached->valid = false; $cached->processed = false; } - return false; } - } \ No newline at end of file From 3a3b8c75a1cc6f61ea1ed7400b548808609c91d7 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Fri, 23 Mar 2018 19:14:53 +0100 Subject: [PATCH 06/31] - bugfix preg_replace could fail on large content resulting in a blank page https://github.com/smarty-php/smarty/issues/417 --- libs/sysplugins/smarty_internal_runtime_codeframe.php | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/sysplugins/smarty_internal_runtime_codeframe.php b/libs/sysplugins/smarty_internal_runtime_codeframe.php index 270f9a55..db303e0a 100644 --- a/libs/sysplugins/smarty_internal_runtime_codeframe.php +++ b/libs/sysplugins/smarty_internal_runtime_codeframe.php @@ -97,7 +97,6 @@ class Smarty_Internal_Runtime_CodeFrame if (preg_match('/\s*\?>[\n]?<\?php\s*/', $output)) { $curr_split = preg_split('/\s*\?>[\n]?<\?php\s*/', $output); - var_dump($curr_split); preg_match_all('/\s*\?>[\n]?<\?php\s*/', $output, $curr_parts); From c81948d60264766585bd21af04fb3a630a7912ce Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Fri, 23 Mar 2018 19:34:18 +0100 Subject: [PATCH 07/31] - bugfix preg_replace could fail on large content resulting in a blank page https://github.com/smarty-php/smarty/issues/417 --- libs/sysplugins/smarty_internal_runtime_updatecache.php | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/sysplugins/smarty_internal_runtime_updatecache.php b/libs/sysplugins/smarty_internal_runtime_updatecache.php index 1fc7bd3e..a3cd21dd 100644 --- a/libs/sysplugins/smarty_internal_runtime_updatecache.php +++ b/libs/sysplugins/smarty_internal_runtime_updatecache.php @@ -72,6 +72,7 @@ class Smarty_Internal_Runtime_UpdateCache $php_pattern = '/(<%|%>|<\?php|<\?|\?>|)/'; $content = ob_get_clean(); $hash_array = $cached->hashes; + $hash_array[$_template->compiled->nocache_hash] = true; $hash_array = array_keys($hash_array); $nocache_hash = '(' . implode('|', $hash_array) . ')'; $_template->cached->has_nocache_code = false; From 0dbace832119c40c2f1d18a87ae96f5b532ddc67 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Mon, 26 Mar 2018 22:35:31 +0200 Subject: [PATCH 08/31] - new feature {parent} = {$smarty.block.parent} {child} = {$smarty.block.child} --- INHERITANCE_RELEASE_NOTES.txt | 9 +- NEW_FEATURES.txt | 9 +- change_log.txt | 3 + libs/Smarty.class.php | 2 +- .../smarty_internal_compile_block.php | 122 +- .../smarty_internal_compile_block_child.php | 24 + .../smarty_internal_compile_block_parent.php | 31 + .../smarty_internal_compile_child.php | 77 + .../smarty_internal_compile_parent.php | 32 + ...ernal_compile_private_special_variable.php | 5 +- .../smarty_internal_runtime_inheritance.php | 64 +- .../smarty_internal_templatelexer.php | 45 +- .../smarty_internal_templateparser.php | 2990 +++++++++-------- .../smarty_internal_testinstall.php | 306 +- 14 files changed, 2012 insertions(+), 1707 deletions(-) create mode 100644 libs/sysplugins/smarty_internal_compile_block_child.php create mode 100644 libs/sysplugins/smarty_internal_compile_block_parent.php create mode 100644 libs/sysplugins/smarty_internal_compile_child.php create mode 100644 libs/sysplugins/smarty_internal_compile_parent.php diff --git a/INHERITANCE_RELEASE_NOTES.txt b/INHERITANCE_RELEASE_NOTES.txt index 2be8645f..67936a81 100644 --- a/INHERITANCE_RELEASE_NOTES.txt +++ b/INHERITANCE_RELEASE_NOTES.txt @@ -1,4 +1,11 @@ -3.1.31-dev +3.1.3" +New tags for inheritance parent and chilD +{parent} == {$smarty.block.parent} +{child} == {$smarty.block.child} +Both tags support the assign attribute like +{child assign=foo} + +3.1.31 New tags for inheritance parent and child {block_parent} == {$smarty.block.parent} {block_child} == {$smarty.block.child} diff --git a/NEW_FEATURES.txt b/NEW_FEATURES.txt index 66a9f604..7632b07e 100644 --- a/NEW_FEATURES.txt +++ b/NEW_FEATURES.txt @@ -2,7 +2,12 @@ This file contains a brief description of new features which have been added to Smarty 3.1 -Smarty 3.1.32 +Smarty 3.1.32 New tags for inheritance parent and child + ========================================= + {parent} == {$smarty.block.parent} + {child} == {$smarty.block.child} + Both tags support the assign attribute like + {child assign=foo} Deprecate functions Smarty::muteExpectedErrors() and Smarty::unmuteExpectedErrors() =================================================================================== @@ -44,7 +49,7 @@ Smarty 3.1.32 .... {/foreach} - Smarty 3.1.31 +Smarty 3.1.31 New tags for inheritance parent and child ========================================= {block_parent} == {$smarty.block.parent} diff --git a/change_log.txt b/change_log.txt index bb7d084f..3d94f2bd 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== 3.1.32 - dev === +26.03.2018 + - new feature {parent} = {$smarty.block.parent} {child} = {$smarty.block.child} + 23.03.2018 - bugfix preg_replace could fail on large content resulting in a blank page https://github.com/smarty-php/smarty/issues/417 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 8563b439..97c679a0 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.32-dev-43'; + const SMARTY_VERSION = '3.1.32-dev-44'; /** * define variable scopes */ diff --git a/libs/sysplugins/smarty_internal_compile_block.php b/libs/sysplugins/smarty_internal_compile_block.php index 557c009c..fa0aa45b 100644 --- a/libs/sysplugins/smarty_internal_compile_block.php +++ b/libs/sysplugins/smarty_internal_compile_block.php @@ -22,7 +22,6 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_Compile_Shared_Inher * @see Smarty_Internal_CompileBase */ public $required_attributes = array('name'); - /** * Attribute definition: Overwrites base class. * @@ -30,7 +29,6 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_Compile_Shared_Inher * @see Smarty_Internal_CompileBase */ public $shorttag_order = array('name'); - /** * Attribute definition: Overwrites base class. * @@ -38,7 +36,6 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_Compile_Shared_Inher * @see Smarty_Internal_CompileBase */ public $option_flags = array('hide', 'nocache'); - /** * Attribute definition: Overwrites base class. * @@ -47,27 +44,20 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_Compile_Shared_Inher */ public $optional_attributes = array('assign'); - /** - * Saved compiler object - * - * @var Smarty_Internal_TemplateCompilerBase - */ - public $compiler = null; - /** * Compiles code for the {block} tag * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $parameter array with compilation parameter * - * @return string compiled code */ - public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) { - if (!isset($compiler->_cache['blockNesting'])) { - $compiler->_cache['blockNesting'] = 0; + if (!isset($compiler->_cache[ 'blockNesting' ])) { + $compiler->_cache[ 'blockNesting' ] = 0; } - if ($compiler->_cache['blockNesting'] === 0) { + if ($compiler->_cache[ 'blockNesting' ] === 0) { // make sure that inheritance gets initialized in template code $this->registerInit($compiler); $this->option_flags = array('hide', 'nocache', 'append', 'prepend'); @@ -76,70 +66,23 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_Compile_Shared_Inher } // check and get attributes $_attr = $this->getAttributes($compiler, $args); - $compiler->_cache['blockNesting']++; + ++$compiler->_cache[ 'blockNesting' ]; $_className = 'Block_' . preg_replace('![^\w]+!', '_', uniqid(rand(), true)); - $compiler->_cache['blockName'][ $compiler->_cache['blockNesting'] ] = $_attr['name']; - $compiler->_cache['blockClass'][ $compiler->_cache['blockNesting'] ] = $_className; - $compiler->_cache['blockParams'][ $compiler->_cache['blockNesting'] ] = array(); - $compiler->_cache['blockParams'][1]['subBlocks'][ trim($_attr['name'], '"\'') ][] = $_className; + $compiler->_cache[ 'blockName' ][ $compiler->_cache[ 'blockNesting' ] ] = $_attr[ 'name' ]; + $compiler->_cache[ 'blockClass' ][ $compiler->_cache[ 'blockNesting' ] ] = $_className; + $compiler->_cache[ 'blockParams' ][ $compiler->_cache[ 'blockNesting' ] ] = array(); + $compiler->_cache[ 'blockParams' ][ 1 ][ 'subBlocks' ][ trim($_attr[ 'name' ], '"\'') ][] = $_className; $this->openTag($compiler, 'block', array($_attr, $compiler->nocache, $compiler->parser->current_buffer, $compiler->template->compiled->has_nocache_code, $compiler->template->caching)); - // must whole block be nocache ? - if ($compiler->tag_nocache) { - $i = 0; - } $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; - // $compiler->suppressNocacheProcessing = true; - if ($_attr['nocache'] === true) { - //$compiler->trigger_template_error('nocache option not allowed', $compiler->parser->lex->taglineno); - } $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template(); $compiler->template->compiled->has_nocache_code = false; $compiler->suppressNocacheProcessing = true; } - - /** - * Compiles code for the {$smarty.block.parent} or {$smarty.block.child}tag - * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param array $parameter array with compilation parameter - * - * @return string compiled code - * @throws \SmartyCompilerException - */ - public function compileSpecialVariable($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) - { - $name = isset($parameter[1]) ? $compiler->getId($parameter[1]) : false; - if (!$name) { - $compiler->trigger_template_error("invalid '\$smarty.block' expected '\$smarty.block.child' or '\$smarty.block.parent'", - null, - true); - } - if (!isset($compiler->_cache['blockNesting'])) { - $compiler->trigger_template_error(" '\$smarty.block.{$name}' used outside {block} tags ", - $compiler->parser->lex->taglineno); - } - $compiler->suppressNocacheProcessing = true; - switch ($name) { - case 'child': - $compiler->_cache['blockParams'][ $compiler->_cache['blockNesting'] ]['callsChild'] = 'true'; - return '$_smarty_tpl->inheritance->callChild($_smarty_tpl, $this, true)'; - break; - case 'parent': - return '$_smarty_tpl->inheritance->callParent($_smarty_tpl, $this, null, true)'; - break; - default: - $compiler->trigger_template_error("invalid '\$smarty.block.{$name}' expected '\$smarty.block.child' or '\$smarty.block.parent'", - null, - true); - } - } } - /** * Smarty Internal Plugin Compile BlockClose Class * @@ -149,27 +92,27 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_Compile_Shared_ /** * Compiles code for the {/block} tag * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $parameter array with compilation parameter * - * @return string compiled code - * @internal param array $parameter array with compilation parameter + * @return bool true */ - public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) { list($_attr, $_nocache, $_buffer, $_has_nocache_code, $_caching) = $this->closeTag($compiler, array('block')); // init block parameter - $_block = $compiler->_cache['blockParams'][ $compiler->_cache['blockNesting'] ]; - unset($compiler->_cache['blockParams'][ $compiler->_cache['blockNesting'] ]); - $_name = $_attr['name']; - $_assign = isset($_attr['assign']) ? $_attr['assign'] : null; - unset($_attr['assign'], $_attr['name']); + $_block = $compiler->_cache[ 'blockParams' ][ $compiler->_cache[ 'blockNesting' ] ]; + unset($compiler->_cache[ 'blockParams' ][ $compiler->_cache[ 'blockNesting' ] ]); + $_name = $_attr[ 'name' ]; + $_assign = isset($_attr[ 'assign' ]) ? $_attr[ 'assign' ] : null; + unset($_attr[ 'assign' ], $_attr[ 'name' ]); foreach ($_attr as $name => $stat) { if ((is_bool($stat) && $stat !== false) || (!is_bool($stat) && $stat !== 'false')) { $_block[ $name ] = 'true'; } } - $_className = $compiler->_cache['blockClass'][ $compiler->_cache['blockNesting'] ]; + $_className = $compiler->_cache[ 'blockClass' ][ $compiler->_cache[ 'blockNesting' ] ]; // get compiled block code $_functionCode = $compiler->parser->current_buffer; // setup buffer for template function code @@ -180,7 +123,7 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_Compile_Shared_ $output .= "class {$_className} extends Smarty_Internal_Block\n"; $output .= "{\n"; foreach ($_block as $property => $value) { - $output .= "public \${$property} = " . var_export($value, true) . ";\n"; + $output .= "public \${$property} = " . var_export($value,true) .";\n"; } $output .= "public function callBlock(Smarty_Internal_Template \$_smarty_tpl) {\n"; //$output .= "/*/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/\n"; @@ -206,13 +149,13 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_Compile_Shared_ $compiler->parser->current_buffer->append_subtree($compiler->parser, new Smarty_Internal_ParseTree_Tag($compiler->parser, $output)); - $compiler->blockOrFunctionCode .= $f = $compiler->parser->current_buffer->to_smarty_php($compiler->parser); + $compiler->blockOrFunctionCode .= $compiler->parser->current_buffer->to_smarty_php($compiler->parser); $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template(); // nocache plugins must be copied - if (!empty($compiler->template->compiled->required_plugins['nocache'])) { - foreach ($compiler->template->compiled->required_plugins['nocache'] as $plugin => $tmp) { + if (!empty($compiler->template->compiled->required_plugins[ 'nocache' ])) { + foreach ($compiler->template->compiled->required_plugins[ 'nocache' ] as $plugin => $tmp) { foreach ($tmp as $type => $data) { - $compiler->parent_compiler->template->compiled->required_plugins['compiled'][ $plugin ][ $type ] = + $compiler->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin ][ $type ] = $data; } } @@ -224,16 +167,17 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_Compile_Shared_ $compiler->nocache = $_nocache; $compiler->parser->current_buffer = $_buffer; $output = "_cache['blockNesting'] === 1) { + if ($compiler->_cache[ 'blockNesting' ] === 1) { $output .= "\$_smarty_tpl->inheritance->instanceBlock(\$_smarty_tpl, '$_className', $_name);\n"; } else { $output .= "\$_smarty_tpl->inheritance->instanceBlock(\$_smarty_tpl, '$_className', $_name, \$this->tplIndex);\n"; } $output .= "?>\n"; - $compiler->_cache['blockNesting']--; - if ($compiler->_cache['blockNesting'] === 0) { - unset($compiler->_cache['blockNesting']); + --$compiler->_cache[ 'blockNesting' ]; + if ($compiler->_cache[ 'blockNesting' ] === 0) { + unset($compiler->_cache[ 'blockNesting' ]); } + $compiler->has_code = true; $compiler->suppressNocacheProcessing = true; return $output; } diff --git a/libs/sysplugins/smarty_internal_compile_block_child.php b/libs/sysplugins/smarty_internal_compile_block_child.php new file mode 100644 index 00000000..1708f648 --- /dev/null +++ b/libs/sysplugins/smarty_internal_compile_block_child.php @@ -0,0 +1,24 @@ + + */ +class Smarty_Internal_Compile_Block_Child extends Smarty_Internal_Compile_Child +{ + /** + * Tag name + * + * @var string + */ + public $tag = 'block_child'; +} \ No newline at end of file diff --git a/libs/sysplugins/smarty_internal_compile_block_parent.php b/libs/sysplugins/smarty_internal_compile_block_parent.php new file mode 100644 index 00000000..4f094ad6 --- /dev/null +++ b/libs/sysplugins/smarty_internal_compile_block_parent.php @@ -0,0 +1,31 @@ + + */ +class Smarty_Internal_Compile_Block_Parent extends Smarty_Internal_Compile_Child +{ + /** + * Tag name + * + * @var string + */ + public $tag = 'block_parent'; + + /** + * Block type + * + * @var string + */ + public $blockType = 'Parent'; +} \ No newline at end of file diff --git a/libs/sysplugins/smarty_internal_compile_child.php b/libs/sysplugins/smarty_internal_compile_child.php new file mode 100644 index 00000000..8c7bbdf0 --- /dev/null +++ b/libs/sysplugins/smarty_internal_compile_child.php @@ -0,0 +1,77 @@ + + */ +class Smarty_Internal_Compile_Child extends Smarty_Internal_CompileBase +{ + /** + * Attribute definition: Overwrites base class. + * + * @var array + * @see Smarty_Internal_CompileBase + */ + public $optional_attributes = array('assign'); + + /** + * Tag name + * + * @var string + */ + public $tag = 'child'; + + /** + * Block type + * + * @var string + */ + public $blockType = 'Child'; + + /** + * Compiles code for the {child} tag + * + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $parameter array with compilation parameter + * + * @return string compiled code + * @throws \SmartyCompilerException + */ + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + { + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + $tag = isset($parameter[0]) ? "'{$parameter[0]}'" : "'{{$this->tag}}'"; + if (!isset($compiler->_cache[ 'blockNesting' ])) { + $compiler->trigger_template_error("{$tag} used outside {block} tags ", + $compiler->parser->lex->taglineno); + } + $compiler->has_code = true; + $compiler->suppressNocacheProcessing = true; + if ($this->blockType === 'Child') { + $compiler->_cache[ 'blockParams' ][ $compiler->_cache[ 'blockNesting' ] ][ 'callsChild' ] = 'true'; + } + $_assign = isset($_attr[ 'assign' ]) ? $_attr[ 'assign' ] : null; + $output = "inheritance->call' . $this->blockType . '($_smarty_tpl, $this' . + ($this->blockType === 'Child' ? '' : ", {$tag}"). ");\n"; + if (isset($_assign)) { + $output .= "\$_smarty_tpl->assign({$_assign}, ob_get_clean());\n"; + } + $output .="?>\n"; + return $output; + } +} \ No newline at end of file diff --git a/libs/sysplugins/smarty_internal_compile_parent.php b/libs/sysplugins/smarty_internal_compile_parent.php new file mode 100644 index 00000000..052479ae --- /dev/null +++ b/libs/sysplugins/smarty_internal_compile_parent.php @@ -0,0 +1,32 @@ + + */ +class Smarty_Internal_Compile_Parent extends Smarty_Internal_Compile_Child +{ + + /** + * Tag name + * + * @var string + */ + public $tag = 'parent'; + + /** + * Block type + * + * @var string + */ + public $blockType = 'Parent'; +} \ No newline at end of file diff --git a/libs/sysplugins/smarty_internal_compile_private_special_variable.php b/libs/sysplugins/smarty_internal_compile_private_special_variable.php index 7982a005..0c6be44f 100644 --- a/libs/sysplugins/smarty_internal_compile_private_special_variable.php +++ b/libs/sysplugins/smarty_internal_compile_private_special_variable.php @@ -51,9 +51,6 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C return ''; case 'now': return 'time()'; - case 'block': - $tag = $compiler->getTagCompiler('block'); - return $tag->compileSpecialVariable(array(), $compiler, $_index); case 'cookies': if (isset($compiler->smarty->security_policy) && !$compiler->smarty->security_policy->allow_super_globals @@ -114,7 +111,7 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C case 'rdelim': return "\$_smarty_tpl->smarty->right_delimiter"; default: - $compiler->trigger_template_error('$smarty.' . trim($_index[ 0 ], '\'') . ' is not defined'); + $compiler->trigger_template_error('$smarty.' . trim($_index[ 0 ], "'") . ' is not defined'); break; } if (isset($_index[ 1 ])) { diff --git a/libs/sysplugins/smarty_internal_runtime_inheritance.php b/libs/sysplugins/smarty_internal_runtime_inheritance.php index 84607ad6..b593b78e 100644 --- a/libs/sysplugins/smarty_internal_runtime_inheritance.php +++ b/libs/sysplugins/smarty_internal_runtime_inheritance.php @@ -42,11 +42,10 @@ class Smarty_Internal_Runtime_Inheritance * * @var int */ - public $tplIndex = -1; + public $tplIndex = - 1; /** * Array of template source objects - * - key template index * * @var Smarty_Template_Source[] */ @@ -75,7 +74,7 @@ class Smarty_Internal_Runtime_Inheritance $tpl->inheritance->init($tpl, $initChild, $blockNames); return; } - $this->tplIndex++; + ++$this->tplIndex; $this->sources[ $this->tplIndex ] = $tpl->source; // start of child sub template(s) @@ -85,7 +84,7 @@ class Smarty_Internal_Runtime_Inheritance //grab any output of child templates ob_start(); } - $this->inheritanceLevel++; + ++$this->inheritanceLevel; // $tpl->startRenderCallbacks[ 'inheritance' ] = array($this, 'subTemplateStart'); // $tpl->endRenderCallbacks[ 'inheritance' ] = array($this, 'subTemplateEnd'); } @@ -109,7 +108,7 @@ class Smarty_Internal_Runtime_Inheritance */ public function endChild(Smarty_Internal_Template $tpl, $template = null, $uid = null, $func = null) { - $this->inheritanceLevel--; + --$this->inheritanceLevel; if (!$this->inheritanceLevel) { ob_end_clean(); $this->state = 2; @@ -167,8 +166,7 @@ class Smarty_Internal_Runtime_Inheritance * * @throws \SmartyException */ - public function process(Smarty_Internal_Template $tpl, - Smarty_Internal_Block $block, + public function process(Smarty_Internal_Template $tpl, Smarty_Internal_Block $block, Smarty_Internal_Block $parent = null) { if ($block->hide && !isset($block->child)) { @@ -179,7 +177,7 @@ class Smarty_Internal_Runtime_Inheritance } $block->parent = $parent; if ($block->append && !$block->prepend && isset($parent)) { - $this->callParent($tpl, $block); + $this->callParent($tpl, $block, '\'{block append}\''); } if ($block->callsChild || !isset($block->child) || ($block->child->hide && !isset($block->child->child))) { $this->callBlock($block, $tpl); @@ -187,7 +185,7 @@ class Smarty_Internal_Runtime_Inheritance $this->process($tpl, $block->child, $block); } if ($block->prepend && isset($parent)) { - $this->callParent($tpl, $block); + $this->callParent($tpl, $block, '{block prepend}'); if ($block->append) { if ($block->callsChild || !isset($block->child) || ($block->child->hide && !isset($block->child->child)) @@ -202,70 +200,42 @@ class Smarty_Internal_Runtime_Inheritance } /** - * Render child on $smarty.block.child + * Render child on \$smarty.block.child * * @param \Smarty_Internal_Template $tpl * @param \Smarty_Internal_Block $block - * @param boolean $returnContent flag if content shall be returned * - * @return null|string null or block content dependent on $returnContent + * @return null|string block content * @throws \SmartyException */ - public function callChild(Smarty_Internal_Template $tpl, Smarty_Internal_Block $block, $returnContent = false) + public function callChild(Smarty_Internal_Template $tpl, Smarty_Internal_Block $block) { - if ($returnContent) { - ob_start(); - } if (isset($block->child)) { $this->process($tpl, $block->child, $block); } - if ($returnContent) { - return ob_get_clean(); - } - return; } /** - * Render parent block on $smarty.block.parent or {block append/prepend} + * Render parent block on \$smarty.block.parent or {block append/prepend} * * @param \Smarty_Internal_Template $tpl * @param \Smarty_Internal_Block $block - * @param null|string $name - * @param boolean $returnContent flag if content shall be returned + * @param string $tag * - * @return null|string null or block content dependent on $returnContent + * @return null|string block content * @throws \SmartyException */ - public function callParent(Smarty_Internal_Template $tpl, - Smarty_Internal_Block $block, - $name = null, - $returnContent = false) + public function callParent(Smarty_Internal_Template $tpl, Smarty_Internal_Block $block, $tag) { - if ($returnContent) { - ob_start(); - } - if (isset($name)) { - $block = $block->parent; - while (isset($block)) { - if (isset($block->subBlocks[ $name ])) { - } else { - $block = $block->parent; - } - } - return; - } else if (isset($block->parent)) { + if (isset($block->parent)) { $this->callBlock($block->parent, $tpl); } else { - throw new SmartyException("inheritance: illegal '\$smarty.block.parent' or {block append/prepend} used in parent template '{$tpl->inheritance->sources[$block->tplIndex]->filepath}' block '{$block->name}'"); + throw new SmartyException("inheritance: illegal '{$tag}' used in child template '{$tpl->inheritance->sources[$block->tplIndex]->filepath}' block '{$block->name}'"); } - if ($returnContent) { - return ob_get_clean(); - } - return; } /** - * redender block + * render block * * @param \Smarty_Internal_Block $block * @param \Smarty_Internal_Template $tpl diff --git a/libs/sysplugins/smarty_internal_templatelexer.php b/libs/sysplugins/smarty_internal_templatelexer.php index 63a76d63..3045a7b0 100644 --- a/libs/sysplugins/smarty_internal_templatelexer.php +++ b/libs/sysplugins/smarty_internal_templatelexer.php @@ -18,10 +18,10 @@ */ class Smarty_Internal_Templatelexer { - const TEXT = 1; - const TAG = 2; - const TAGBODY = 3; - const LITERAL = 4; + const TEXT = 1; + const TAG = 2; + const TAGBODY = 3; + const LITERAL = 4; const DOUBLEQUOTEDSTRING = 5; /** * Source @@ -192,8 +192,8 @@ class Smarty_Internal_Templatelexer * @var null */ private $yy_global_pattern5 = null; - private $_yy_state = 1; - private $_yy_stack = array(); + private $_yy_state = 1; + private $_yy_stack = array(); /** * constructor @@ -239,7 +239,7 @@ class Smarty_Internal_Templatelexer return $this->compiler->replaceDelimiter($preg); } - /** + /** * check if current value is an autoliteral left delimiter * * @return bool @@ -306,7 +306,7 @@ class Smarty_Internal_Templatelexer } } - public function yylex1() +public function yylex1() { if (!isset($this->yy_global_pattern1)) { $this->yy_global_pattern1 = @@ -398,7 +398,7 @@ class Smarty_Internal_Templatelexer $this->yypushstate(self::LITERAL); } - function yy_r1_12() + function yy_r1_12() { $this->token = Smarty_Internal_Templateparser::TP_LITERALEND; $this->yypushstate(self::LITERAL); @@ -420,11 +420,11 @@ class Smarty_Internal_Templatelexer $this->token = Smarty_Internal_Templateparser::TP_TEXT; } - public function yylex2() +public function yylex2() { if (!isset($this->yy_global_pattern2)) { $this->yy_global_pattern2 = - $this->replace("/\G((SMARTYldel)SMARTYal(if|elseif|else if|while)\\s+)|\G((SMARTYldel)SMARTYalfor\\s+)|\G((SMARTYldel)SMARTYalforeach(?![^\s]))|\G((SMARTYldel)SMARTYalsetfilter\\s+)|\G((SMARTYldel)SMARTYalmake_nocache\\s+)|\G((SMARTYldel)SMARTYal[0-9]*[a-zA-Z_]\\w*(\\s+nocache)?\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/](?:(?!block)[0-9]*[a-zA-Z_]\\w*)\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[$][0-9]*[a-zA-Z_]\\w*(\\s+nocache)?\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/])|\G((SMARTYldel)SMARTYal)/isS"); + $this->replace("/\G((SMARTYldel)SMARTYal(if|elseif|else if|while)\\s+)|\G((SMARTYldel)SMARTYalfor\\s+)|\G((SMARTYldel)SMARTYalforeach(?![^\s]))|\G((SMARTYldel)SMARTYalsetfilter\\s+)|\G((SMARTYldel)SMARTYalmake_nocache\\s+)|\G((SMARTYldel)SMARTYal[0-9]*[a-zA-Z_]\\w*(\\s+nocache)?\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[$]smarty\\.block\\.(child|parent)\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/][0-9]*[a-zA-Z_]\\w*\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[$][0-9]*[a-zA-Z_]\\w*(\\s+nocache)?\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/])|\G((SMARTYldel)SMARTYal)/isS"); } if (!isset($this->dataLength)) { $this->dataLength = strlen($this->data); @@ -518,13 +518,20 @@ class Smarty_Internal_Templatelexer } function yy_r2_15() + { + $this->yypopstate(); + $this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILDPARENT; + $this->taglineno = $this->line; + } + + function yy_r2_18() { $this->yypopstate(); $this->token = Smarty_Internal_Templateparser::TP_CLOSETAG; $this->taglineno = $this->line; } - function yy_r2_17() + function yy_r2_20() { if ($this->_yy_stack[ count($this->_yy_stack) - 1 ] === self::TEXT) { $this->yypopstate(); @@ -538,21 +545,21 @@ class Smarty_Internal_Templatelexer } } // end function - function yy_r2_20() + function yy_r2_23() { $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; $this->yybegin(self::TAGBODY); $this->taglineno = $this->line; } - function yy_r2_22() + function yy_r2_25() { $this->token = Smarty_Internal_Templateparser::TP_LDEL; $this->yybegin(self::TAGBODY); $this->taglineno = $this->line; } - public function yylex3() +public function yylex3() { if (!isset($this->yy_global_pattern3)) { $this->yy_global_pattern3 = @@ -830,7 +837,7 @@ class Smarty_Internal_Templatelexer $this->token = Smarty_Internal_Templateparser::TP_HEX; } - function yy_r3_58() + function yy_r3_58() { $this->token = Smarty_Internal_Templateparser::TP_SPACE; } // end function @@ -840,7 +847,7 @@ class Smarty_Internal_Templatelexer $this->token = Smarty_Internal_Templateparser::TP_TEXT; } - public function yylex4() +public function yylex4() { if (!isset($this->yy_global_pattern4)) { $this->yy_global_pattern4 = @@ -912,12 +919,12 @@ class Smarty_Internal_Templatelexer } } - function yy_r4_5() + function yy_r4_5() { $this->token = Smarty_Internal_Templateparser::TP_LITERAL; } // end function - public function yylex5() +public function yylex5() { if (!isset($this->yy_global_pattern5)) { $this->yy_global_pattern5 = diff --git a/libs/sysplugins/smarty_internal_templateparser.php b/libs/sysplugins/smarty_internal_templateparser.php index d58499fb..d8219dae 100644 --- a/libs/sysplugins/smarty_internal_templateparser.php +++ b/libs/sysplugins/smarty_internal_templateparser.php @@ -9,6 +9,7 @@ class TP_yyStackEntry ** is the value of the token */ } +; #line 11 "../smarty/lexer/smarty_internal_templateparser.y" /** @@ -22,642 +23,788 @@ class TP_yyStackEntry class Smarty_Internal_Templateparser { #line 23 "../smarty/lexer/smarty_internal_templateparser.y" - const Err1 = 'Security error: Call to private object member not allowed'; - const Err2 = 'Security error: Call to dynamic object member not allowed'; - const Err3 = 'PHP in template not allowed. Use SmartyBC to enable it'; - const TP_VERT = 1; - const TP_COLON = 2; - const TP_UNIMATH = 3; - const TP_PHP = 4; - const TP_TEXT = 5; - const TP_STRIPON = 6; - const TP_STRIPOFF = 7; - const TP_LITERALSTART = 8; - const TP_LITERALEND = 9; - const TP_LITERAL = 10; - const TP_SIMPELOUTPUT = 11; - const TP_SIMPLETAG = 12; - const TP_LDEL = 13; - const TP_RDEL = 14; - const TP_DOLLARID = 15; - const TP_EQUAL = 16; - const TP_ID = 17; - const TP_PTR = 18; - const TP_LDELMAKENOCACHE = 19; - const TP_LDELIF = 20; - const TP_LDELFOR = 21; - const TP_SEMICOLON = 22; - const TP_INCDEC = 23; - const TP_TO = 24; - const TP_STEP = 25; - const TP_LDELFOREACH = 26; - const TP_SPACE = 27; - const TP_AS = 28; - const TP_APTR = 29; - const TP_LDELSETFILTER = 30; - const TP_CLOSETAG = 31; - const TP_LDELSLASH = 32; - const TP_ATTR = 33; - const TP_INTEGER = 34; - const TP_COMMA = 35; - const TP_OPENP = 36; - const TP_CLOSEP = 37; - const TP_MATH = 38; - const TP_ISIN = 39; - const TP_QMARK = 40; - const TP_NOT = 41; - const TP_TYPECAST = 42; - const TP_HEX = 43; - const TP_DOT = 44; - const TP_INSTANCEOF = 45; - const TP_SINGLEQUOTESTRING = 46; - const TP_DOUBLECOLON = 47; - const TP_NAMESPACE = 48; - const TP_AT = 49; - const TP_HATCH = 50; - const TP_OPENB = 51; - const TP_CLOSEB = 52; - const TP_DOLLAR = 53; - const TP_LOGOP = 54; - const TP_SLOGOP = 55; - const TP_TLOGOP = 56; - const TP_SINGLECOND = 57; - const TP_QUOTE = 58; - const TP_BACKTICK = 59; - const YY_NO_ACTION = 509; - const YY_ACCEPT_ACTION = 508; - const YY_ERROR_ACTION = 507; - const YY_SZ_ACTTAB = 1956; - const YY_SHIFT_USE_DFLT = -13; - const YY_SHIFT_MAX = 227; - const YY_REDUCE_USE_DFLT = -75; - const YY_REDUCE_MAX = 176; - const YYNOCODE = 107; - const YYSTACKDEPTH = 500; - const YYNSTATE = 322; - const YYNRULE = 185; - const YYERRORSYMBOL = 60; - const YYERRSYMDT = 'yy0'; - const YYFALLBACK = 0; - static public $yy_action = array( - 41, 15, 301, 113, 209, 252, 254, 12, 274, 275, - 1, 251, 124, 95, 183, 165, 211, 10, 79, 141, - 14, 204, 248, 107, 6, 316, 17, 212, 250, 215, - 452, 188, 452, 13, 9, 23, 452, 436, 42, 38, - 258, 213, 287, 225, 41, 193, 32, 77, 3, 230, - 302, 295, 274, 275, 1, 75, 128, 132, 189, 83, - 211, 10, 79, 436, 200, 204, 436, 107, 452, 153, - 436, 212, 250, 215, 452, 206, 452, 26, 85, 4, - 452, 436, 42, 38, 258, 213, 306, 310, 41, 193, - 246, 77, 3, 116, 302, 302, 274, 275, 1, 75, - 127, 247, 189, 171, 211, 10, 79, 436, 7, 18, - 436, 107, 452, 166, 436, 212, 250, 215, 452, 206, - 452, 13, 202, 74, 452, 436, 42, 38, 258, 213, - 238, 310, 41, 193, 97, 77, 3, 175, 302, 205, - 274, 275, 1, 75, 127, 247, 179, 240, 211, 10, - 79, 436, 321, 204, 436, 107, 452, 190, 436, 212, - 250, 215, 452, 194, 452, 13, 253, 74, 452, 436, - 42, 38, 258, 213, 37, 310, 41, 193, 168, 77, - 3, 294, 302, 14, 274, 275, 1, 75, 127, 17, - 177, 149, 211, 10, 79, 436, 266, 267, 436, 107, - 452, 265, 436, 212, 250, 215, 452, 206, 452, 13, - 190, 190, 452, 436, 42, 38, 258, 213, 129, 310, - 41, 193, 190, 77, 3, 11, 302, 201, 274, 275, - 1, 75, 126, 436, 189, 22, 211, 10, 79, 436, - 436, 17, 436, 107, 452, 167, 436, 212, 250, 215, - 128, 206, 255, 13, 39, 28, 307, 87, 42, 38, - 258, 213, 312, 310, 41, 193, 89, 77, 3, 175, - 302, 232, 274, 275, 1, 75, 127, 173, 189, 267, - 211, 10, 79, 261, 252, 77, 12, 107, 302, 279, - 251, 212, 250, 215, 35, 178, 182, 13, 260, 21, - 14, 92, 42, 38, 258, 213, 17, 310, 41, 193, - 158, 77, 3, 138, 302, 259, 274, 275, 1, 75, - 127, 252, 184, 12, 211, 10, 79, 251, 219, 30, - 104, 107, 423, 5, 302, 212, 250, 215, 31, 206, - 226, 13, 144, 423, 105, 291, 42, 38, 258, 213, - 151, 310, 41, 193, 20, 77, 3, 205, 302, 207, - 274, 275, 1, 75, 125, 452, 189, 452, 211, 10, - 79, 452, 161, 292, 24, 107, 233, 6, 302, 212, - 250, 215, 128, 206, 218, 8, 21, 4, 136, 92, - 42, 38, 258, 213, 308, 310, 41, 193, 265, 77, - 3, 116, 302, 452, 274, 275, 1, 75, 91, 252, - 76, 12, 211, 10, 79, 251, 171, 77, 104, 107, - 302, 164, 423, 212, 250, 215, 301, 206, 209, 13, - 220, 315, 135, 423, 42, 38, 258, 213, 229, 310, - 41, 193, 265, 77, 3, 175, 302, 222, 274, 275, - 1, 75, 128, 452, 189, 452, 211, 10, 79, 452, - 171, 190, 241, 107, 237, 80, 298, 212, 250, 215, - 34, 206, 92, 26, 24, 231, 244, 423, 42, 38, - 258, 213, 247, 310, 23, 193, 78, 77, 423, 33, - 302, 305, 214, 209, 280, 75, 84, 103, 129, 181, - 94, 56, 302, 131, 74, 11, 95, 170, 101, 256, - 245, 16, 436, 424, 309, 192, 311, 281, 316, 436, - 305, 214, 209, 280, 424, 84, 103, 190, 180, 94, - 64, 175, 253, 163, 262, 95, 160, 292, 256, 245, - 376, 302, 216, 309, 192, 311, 305, 316, 209, 217, - 196, 100, 99, 376, 195, 106, 68, 175, 133, 376, - 19, 95, 86, 283, 256, 245, 154, 236, 265, 309, - 192, 311, 305, 316, 209, 276, 265, 100, 103, 205, - 180, 94, 64, 187, 297, 282, 175, 95, 155, 264, - 256, 245, 377, 257, 227, 309, 192, 311, 265, 316, - 271, 272, 273, 270, 122, 377, 269, 274, 275, 1, - 24, 377, 290, 284, 423, 211, 10, 79, 169, 134, - 221, 249, 107, 88, 216, 423, 212, 250, 215, 265, - 305, 210, 209, 152, 99, 98, 263, 343, 195, 114, - 50, 172, 210, 265, 228, 95, 247, 175, 256, 245, - 343, 190, 278, 309, 192, 311, 343, 316, 117, 299, - 142, 137, 264, 264, 344, 274, 275, 2, 74, 300, - 161, 292, 216, 211, 10, 79, 268, 344, 209, 239, - 107, 299, 99, 344, 212, 250, 215, 274, 275, 2, - 157, 300, 190, 37, 167, 211, 10, 79, 92, 139, - 265, 110, 107, 39, 28, 307, 212, 250, 215, 99, - 303, 143, 286, 27, 305, 190, 209, 43, 175, 98, - 147, 265, 195, 114, 45, 277, 108, 104, 262, 95, - 265, 81, 256, 245, 285, 27, 109, 309, 192, 311, - 305, 316, 209, 264, 113, 100, 148, 208, 195, 106, - 68, 82, 40, 36, 95, 95, 162, 292, 256, 245, - 190, 508, 90, 309, 192, 311, 316, 316, 320, 318, - 317, 314, 305, 379, 209, 203, 199, 100, 296, 138, - 195, 114, 63, 130, 92, 289, 379, 95, 264, 150, - 256, 245, 379, 293, 247, 309, 192, 311, 343, 316, - 305, 159, 209, 293, 343, 100, 197, 293, 195, 114, - 63, 293, 293, 293, 293, 95, 74, 293, 256, 245, - 293, 293, 293, 309, 192, 311, 293, 316, 293, 293, - 305, 293, 209, 293, 198, 100, 293, 293, 195, 114, - 63, 293, 293, 293, 293, 95, 293, 293, 256, 245, - 293, 293, 293, 309, 192, 311, 293, 316, 293, 293, - 293, 305, 293, 209, 191, 293, 100, 293, 293, 195, - 114, 49, 293, 190, 293, 43, 95, 293, 293, 256, - 245, 293, 293, 293, 309, 192, 311, 293, 316, 305, - 293, 209, 293, 293, 100, 293, 293, 195, 114, 61, - 293, 293, 293, 293, 95, 293, 293, 256, 245, 293, - 40, 36, 309, 192, 311, 305, 316, 209, 293, 293, - 100, 293, 293, 195, 114, 69, 320, 318, 317, 314, - 95, 293, 293, 256, 245, 293, 293, 293, 309, 192, - 311, 293, 316, 293, 293, 305, 293, 209, 293, 293, - 100, 293, 293, 195, 114, 66, 293, 190, 293, 43, - 95, 293, 293, 256, 245, 293, 293, 293, 309, 192, - 311, 293, 316, 305, 293, 209, 293, 293, 100, 293, - 293, 195, 114, 54, 146, 293, 293, 293, 95, 293, - 293, 256, 245, 293, 40, 36, 309, 192, 311, 305, - 316, 209, 293, 293, 100, 293, 293, 195, 114, 53, - 320, 318, 317, 314, 95, 293, 293, 256, 245, 293, - 293, 293, 309, 192, 311, 293, 316, 293, 293, 305, - 293, 209, 293, 293, 100, 293, 293, 195, 114, 47, - 293, 190, 25, 43, 95, 293, 293, 256, 245, 293, - 293, 293, 309, 192, 311, 293, 316, 305, 293, 209, - 293, 293, 100, 293, 293, 195, 96, 59, 293, 293, - 293, 293, 95, 293, 293, 256, 245, 293, 40, 36, - 309, 192, 311, 305, 316, 209, 293, 293, 100, 293, - 293, 195, 114, 73, 320, 318, 317, 314, 95, 293, - 293, 256, 245, 293, 293, 293, 309, 192, 311, 293, - 316, 293, 293, 305, 293, 209, 293, 293, 100, 293, - 293, 195, 114, 71, 293, 190, 293, 43, 95, 293, - 293, 256, 245, 293, 293, 293, 309, 192, 311, 293, - 316, 305, 293, 209, 293, 293, 100, 293, 293, 185, - 102, 52, 293, 293, 293, 293, 95, 293, 293, 256, - 245, 234, 40, 36, 309, 192, 311, 305, 316, 209, - 293, 293, 100, 293, 293, 195, 93, 65, 320, 318, - 317, 314, 95, 293, 293, 256, 245, 293, 293, 293, - 309, 192, 311, 293, 316, 293, 293, 305, 293, 209, - 293, 293, 100, 293, 293, 195, 114, 46, 293, 190, - 293, 43, 95, 293, 293, 256, 245, 293, 293, 293, - 309, 192, 311, 293, 316, 305, 293, 209, 293, 293, - 100, 293, 293, 195, 114, 58, 293, 293, 293, 293, - 95, 293, 293, 256, 245, 223, 40, 36, 309, 192, - 311, 305, 316, 209, 293, 293, 100, 293, 293, 195, - 114, 50, 320, 318, 317, 314, 95, 293, 293, 256, - 245, 293, 293, 293, 309, 192, 311, 293, 316, 293, - 293, 305, 293, 209, 293, 293, 100, 293, 293, 195, - 114, 44, 293, 190, 293, 43, 95, 293, 293, 256, - 245, 293, 293, 293, 309, 192, 311, 293, 316, 305, - 293, 209, 293, 293, 100, 293, 293, 195, 114, 48, - 293, 293, 293, 293, 95, 293, 293, 256, 245, 293, - 40, 36, 309, 192, 311, 305, 316, 209, 293, 293, - 100, 293, 293, 195, 114, 72, 320, 318, 317, 314, - 95, 293, 293, 256, 245, 293, 293, 293, 309, 192, - 311, 293, 316, 293, 293, 305, 293, 209, 293, 293, - 100, 293, 293, 195, 114, 51, 293, 293, 293, 43, - 95, 293, 293, 256, 245, 293, 293, 293, 309, 192, - 311, 293, 316, 305, 293, 209, 293, 293, 100, 293, - 293, 195, 114, 67, 293, 293, 293, 293, 95, 293, - 293, 256, 245, 293, 40, 36, 309, 192, 311, 305, - 316, 209, 293, 293, 100, 293, 293, 186, 114, 57, - 320, 318, 317, 314, 95, 293, 293, 256, 245, 293, - 293, 293, 309, 192, 311, 293, 316, 293, 293, 305, - 293, 209, 293, 293, 100, 293, 293, 195, 114, 60, - 293, 293, 293, 293, 95, 293, 293, 256, 245, 293, - 293, 293, 309, 192, 311, 293, 316, 305, 293, 209, - 293, 293, 100, 293, 293, 195, 114, 62, 293, 293, - 293, 293, 95, 293, 293, 256, 245, 293, 293, 293, - 309, 192, 311, 305, 316, 209, 293, 293, 100, 293, - 293, 195, 114, 70, 293, 293, 293, 293, 95, 293, - 293, 256, 245, 293, 293, 293, 309, 192, 311, 293, - 316, 293, 293, 305, 293, 209, 293, 293, 100, 293, - 293, 195, 93, 55, 389, 389, 389, 293, 95, 293, - 293, 256, 245, 293, 293, 293, 309, 192, 311, 293, - 316, 305, 293, 209, 293, 293, 100, 293, 293, 195, - 118, 293, 293, 293, 293, 293, 95, 293, 293, 423, - 304, 389, 389, 293, 309, 192, 311, 190, 316, 43, - 423, 190, 293, 43, 293, 293, 293, 389, 389, 389, - 389, 293, 293, 293, 293, 293, 293, 305, 293, 209, - 293, 29, 100, 14, 293, 195, 123, 14, 293, 17, - 293, 293, 95, 17, 40, 36, 243, 293, 40, 36, - 309, 192, 311, 293, 316, 293, 293, 293, 293, 293, - 320, 318, 317, 314, 320, 318, 317, 314, 204, 293, - 293, 293, 293, 305, 293, 209, 293, 452, 100, 452, - 293, 195, 121, 452, 436, 293, 293, 293, 95, 293, - 293, 293, 293, 293, 293, 293, 309, 192, 311, 305, - 316, 209, 293, 190, 100, 43, 293, 195, 112, 293, - 436, 293, 293, 436, 95, 452, 174, 436, 313, 293, - 293, 293, 309, 192, 311, 293, 316, 305, 293, 209, - 293, 293, 100, 140, 293, 195, 111, 167, 293, 293, - 40, 36, 95, 265, 293, 293, 39, 28, 307, 293, - 309, 192, 311, 293, 316, 293, 320, 318, 317, 314, - 293, 175, 305, 293, 209, 293, 293, 100, 293, 293, - 195, 119, 293, 305, 293, 209, 293, 95, 100, 293, - 293, 195, 115, 293, 293, 309, 192, 311, 95, 316, - 293, 293, 293, 293, 293, 293, 309, 192, 311, 293, - 316, 305, 190, 209, 43, 293, 100, 293, 293, 195, - 120, 293, 293, 293, 293, 293, 95, 293, 293, 293, - 293, 293, 293, 293, 309, 192, 311, 293, 316, 293, - 190, 156, 43, 293, 190, 167, 43, 293, 293, 40, - 36, 265, 293, 235, 39, 28, 307, 288, 293, 293, - 293, 293, 293, 319, 293, 320, 318, 317, 314, 175, - 190, 293, 43, 293, 190, 293, 43, 40, 36, 293, - 293, 40, 36, 242, 293, 293, 293, 176, 293, 293, - 293, 293, 293, 320, 318, 317, 314, 320, 318, 317, - 314, 293, 293, 293, 293, 293, 293, 40, 36, 293, - 293, 40, 36, 293, 293, 293, 293, 293, 293, 293, - 293, 293, 293, 320, 318, 317, 314, 320, 318, 317, - 314, 293, 190, 293, 293, 293, 293, 293, 383, 293, - 293, 293, 293, 293, 293, 347, 383, 293, 383, 224, - 293, 383, 293, 293, 293, 293, 293, 383, 14, 383, - 293, 383, 293, 252, 17, 12, 293, 423, 205, 251, - 293, 293, 293, 293, 293, 293, 293, 293, 423, 14, - 293, 145, 293, 293, 293, 17, + const Err1 = 'Security error: Call to private object member not allowed'; + const Err2 = 'Security error: Call to dynamic object member not allowed'; + const Err3 = 'PHP in template not allowed. Use SmartyBC to enable it'; + const TP_VERT = 1; + const TP_COLON = 2; + const TP_UNIMATH = 3; + const TP_PHP = 4; + const TP_TEXT = 5; + const TP_STRIPON = 6; + const TP_STRIPOFF = 7; + const TP_LITERALSTART = 8; + const TP_LITERALEND = 9; + const TP_LITERAL = 10; + const TP_SIMPELOUTPUT = 11; + const TP_SIMPLETAG = 12; + const TP_SMARTYBLOCKCHILDPARENT = 13; + const TP_LDEL = 14; + const TP_RDEL = 15; + const TP_DOLLARID = 16; + const TP_EQUAL = 17; + const TP_ID = 18; + const TP_PTR = 19; + const TP_LDELMAKENOCACHE = 20; + const TP_LDELIF = 21; + const TP_LDELFOR = 22; + const TP_SEMICOLON = 23; + const TP_INCDEC = 24; + const TP_TO = 25; + const TP_STEP = 26; + const TP_LDELFOREACH = 27; + const TP_SPACE = 28; + const TP_AS = 29; + const TP_APTR = 30; + const TP_LDELSETFILTER = 31; + const TP_CLOSETAG = 32; + const TP_LDELSLASH = 33; + const TP_ATTR = 34; + const TP_INTEGER = 35; + const TP_COMMA = 36; + const TP_OPENP = 37; + const TP_CLOSEP = 38; + const TP_MATH = 39; + const TP_ISIN = 40; + const TP_QMARK = 41; + const TP_NOT = 42; + const TP_TYPECAST = 43; + const TP_HEX = 44; + const TP_DOT = 45; + const TP_INSTANCEOF = 46; + const TP_SINGLEQUOTESTRING = 47; + const TP_DOUBLECOLON = 48; + const TP_NAMESPACE = 49; + const TP_AT = 50; + const TP_HATCH = 51; + const TP_OPENB = 52; + const TP_CLOSEB = 53; + const TP_DOLLAR = 54; + const TP_LOGOP = 55; + const TP_SLOGOP = 56; + const TP_TLOGOP = 57; + const TP_SINGLECOND = 58; + const TP_QUOTE = 59; + const TP_BACKTICK = 60; + const YY_NO_ACTION = 511; + const YY_ACCEPT_ACTION = 510; + const YY_ERROR_ACTION = 509; + const YY_SZ_ACTTAB = 2178; + const YY_SHIFT_USE_DFLT = -23; + const YY_SHIFT_MAX = 227; + const YY_REDUCE_USE_DFLT = -68; + const YY_REDUCE_MAX = 176; + const YYNOCODE = 108; + const YYSTACKDEPTH = 500; + const YYNSTATE = 323; + const YYNRULE = 186; + const YYERRORSYMBOL = 61; + const YYERRSYMDT = 'yy0'; + const YYFALLBACK = 0; + /** + * result status + * + * @var bool + */ + public $successful = true; + /** + * return value + * + * @var mixed + */ + public $retvalue = 0; + /** + * @var + */ + public $yymajor; + /** + * last index of array variable + * + * @var mixed + */ + public $last_index; + /** + * last variable name + * + * @var string + */ + public $last_variable; + /** + * root parse tree buffer + * + * @var Smarty_Internal_ParseTree + */ + public $root_buffer; + /** + * current parse tree object + * + * @var Smarty_Internal_ParseTree + */ + public $current_buffer; + /** + * lexer object + * + * @var Smarty_Internal_Templatelexer + */ + public $lex; + /** + * internal error flag + * + * @var bool + */ + private $internalError = false; + /** + * {strip} status + * + * @var bool + */ + public $strip = false; + /** + * compiler object + * + * @var Smarty_Internal_TemplateCompilerBase + */ + public $compiler = null; + /** + * smarty object + * + * @var Smarty + */ + public $smarty = null; + /** + * template object + * + * @var Smarty_Internal_Template + */ + public $template = null; + /** + * block nesting level + * + * @var int + */ + public $block_nesting_level = 0; + /** + * security object + * + * @var Smarty_Security + */ + public $security = null; + /** + * template prefix array + * + * @var \Smarty_Internal_ParseTree[] + */ + public $template_prefix = array(); + /** + * template prefix array + * + * @var \Smarty_Internal_ParseTree[] + */ + public $template_postfix = array(); + static public $yy_action = array( + 43, 266, 267, 379, 115, 203, 33, 201, 274, 275, + 281, 1, 13, 124, 93, 183, 379, 217, 6, 79, + 253, 89, 379, 16, 102, 425, 304, 252, 218, 249, + 211, 129, 190, 302, 26, 213, 425, 33, 11, 39, + 42, 283, 209, 13, 223, 385, 195, 233, 77, 3, + 236, 290, 43, 385, 170, 385, 75, 17, 385, 94, + 274, 275, 281, 1, 385, 128, 385, 196, 385, 217, + 6, 79, 80, 298, 158, 210, 102, 156, 174, 133, + 218, 249, 211, 85, 208, 290, 28, 264, 101, 264, + 199, 39, 42, 283, 209, 31, 312, 182, 195, 259, + 77, 3, 43, 290, 23, 172, 239, 174, 75, 288, + 274, 275, 281, 1, 167, 127, 256, 196, 248, 217, + 6, 79, 345, 40, 20, 305, 102, 248, 345, 157, + 218, 249, 211, 83, 208, 290, 26, 8, 174, 264, + 74, 39, 42, 283, 209, 131, 312, 292, 195, 74, + 77, 3, 43, 290, 295, 99, 243, 174, 75, 345, + 274, 275, 281, 1, 15, 126, 86, 196, 248, 217, + 6, 79, 345, 322, 161, 289, 102, 87, 345, 165, + 218, 249, 211, 290, 208, 115, 26, 128, 255, 221, + 74, 39, 42, 283, 209, 93, 312, 210, 195, 162, + 77, 3, 43, 290, 254, 235, 247, 304, 75, 27, + 274, 275, 281, 1, 172, 127, 425, 177, 248, 217, + 6, 79, 77, 174, 250, 290, 102, 425, 198, 14, + 218, 249, 211, 248, 208, 34, 26, 222, 206, 139, + 74, 39, 42, 283, 209, 198, 312, 23, 195, 291, + 77, 3, 43, 290, 300, 74, 198, 438, 75, 346, + 274, 275, 281, 1, 438, 127, 176, 196, 267, 217, + 6, 79, 346, 161, 289, 290, 102, 23, 346, 238, + 218, 249, 211, 33, 178, 263, 26, 160, 289, 13, + 37, 39, 42, 283, 209, 198, 312, 212, 195, 250, + 77, 3, 43, 290, 216, 189, 155, 97, 75, 381, + 274, 275, 281, 1, 149, 127, 264, 179, 18, 217, + 6, 79, 381, 94, 97, 237, 102, 140, 381, 251, + 218, 249, 211, 4, 194, 94, 26, 264, 198, 37, + 30, 39, 42, 283, 209, 198, 312, 212, 195, 129, + 77, 3, 43, 290, 219, 172, 11, 97, 75, 378, + 274, 275, 281, 1, 101, 127, 438, 186, 210, 217, + 6, 79, 378, 438, 12, 163, 102, 220, 378, 425, + 218, 249, 211, 302, 208, 213, 26, 225, 215, 187, + 425, 39, 42, 283, 209, 234, 312, 7, 195, 212, + 77, 3, 43, 290, 134, 9, 240, 425, 75, 97, + 274, 275, 281, 1, 264, 91, 109, 76, 425, 217, + 6, 79, 253, 293, 426, 16, 102, 251, 198, 252, + 218, 249, 211, 198, 208, 426, 26, 148, 198, 135, + 132, 39, 42, 283, 209, 143, 312, 264, 195, 264, + 77, 3, 43, 290, 138, 264, 205, 24, 75, 166, + 274, 275, 281, 1, 264, 125, 276, 196, 19, 217, + 6, 79, 454, 153, 13, 454, 102, 168, 290, 454, + 218, 249, 211, 174, 208, 314, 5, 136, 210, 251, + 152, 39, 42, 283, 209, 268, 312, 213, 195, 308, + 77, 3, 43, 290, 94, 169, 111, 144, 75, 251, + 274, 275, 281, 1, 229, 128, 7, 196, 313, 217, + 6, 79, 510, 90, 175, 111, 102, 164, 289, 174, + 218, 249, 211, 101, 208, 265, 28, 32, 128, 150, + 261, 39, 42, 283, 209, 10, 312, 317, 195, 224, + 77, 21, 269, 290, 232, 230, 282, 114, 75, 307, + 214, 213, 279, 22, 84, 103, 246, 181, 92, 64, + 260, 262, 454, 77, 93, 454, 290, 257, 316, 454, + 438, 228, 311, 197, 309, 78, 304, 271, 272, 273, + 270, 121, 258, 310, 274, 275, 281, 1, 17, 280, + 110, 284, 81, 217, 6, 79, 438, 146, 94, 438, + 102, 454, 151, 438, 218, 249, 211, 307, 214, 213, + 279, 278, 84, 103, 104, 180, 92, 56, 263, 159, + 130, 152, 93, 295, 137, 257, 316, 295, 251, 88, + 311, 197, 309, 82, 304, 307, 295, 213, 303, 295, + 100, 295, 295, 193, 105, 59, 295, 295, 295, 295, + 93, 295, 295, 257, 316, 295, 295, 295, 311, 197, + 309, 307, 304, 213, 277, 295, 100, 103, 295, 181, + 92, 64, 200, 297, 295, 253, 93, 295, 16, 257, + 316, 295, 252, 295, 311, 197, 309, 295, 304, 295, + 299, 295, 295, 295, 295, 295, 274, 275, 281, 2, + 295, 301, 295, 295, 295, 217, 6, 79, 253, 295, + 295, 16, 102, 299, 204, 252, 218, 249, 211, 274, + 275, 281, 2, 295, 301, 33, 295, 154, 217, 6, + 79, 13, 295, 295, 295, 102, 295, 295, 295, 218, + 249, 211, 295, 295, 286, 25, 307, 295, 213, 295, + 295, 100, 295, 295, 193, 105, 59, 295, 295, 295, + 295, 93, 295, 295, 257, 316, 295, 287, 25, 311, + 197, 309, 307, 304, 213, 295, 454, 100, 295, 454, + 193, 118, 67, 454, 296, 253, 295, 93, 16, 295, + 257, 316, 252, 295, 295, 311, 197, 309, 295, 304, + 295, 295, 307, 295, 213, 295, 188, 100, 295, 295, + 193, 118, 67, 295, 295, 454, 295, 93, 295, 295, + 257, 316, 295, 295, 226, 311, 197, 309, 295, 304, + 295, 295, 307, 295, 213, 295, 192, 100, 295, 295, + 193, 118, 67, 295, 295, 295, 295, 93, 295, 295, + 257, 316, 295, 295, 295, 311, 197, 309, 295, 304, + 295, 295, 307, 295, 213, 295, 191, 98, 295, 295, + 193, 118, 46, 295, 108, 295, 295, 93, 295, 295, + 257, 316, 295, 295, 295, 311, 197, 309, 307, 304, + 213, 295, 295, 98, 295, 295, 193, 118, 47, 295, + 219, 295, 295, 93, 295, 295, 257, 316, 295, 295, + 295, 311, 197, 309, 307, 304, 213, 295, 295, 100, + 295, 295, 193, 118, 45, 295, 295, 295, 295, 93, + 295, 295, 257, 316, 295, 295, 295, 311, 197, 309, + 295, 304, 295, 295, 307, 295, 213, 295, 295, 100, + 295, 295, 193, 118, 70, 295, 295, 295, 295, 93, + 295, 295, 257, 316, 295, 295, 295, 311, 197, 309, + 307, 304, 213, 295, 295, 100, 295, 295, 193, 118, + 49, 295, 295, 295, 295, 93, 295, 295, 257, 316, + 295, 295, 295, 311, 197, 309, 307, 304, 213, 295, + 295, 100, 295, 295, 193, 96, 66, 295, 295, 295, + 295, 93, 295, 295, 257, 316, 295, 295, 295, 311, + 197, 309, 295, 304, 295, 295, 307, 295, 213, 295, + 295, 100, 295, 295, 193, 118, 44, 295, 295, 295, + 295, 93, 295, 295, 257, 316, 295, 295, 295, 311, + 197, 309, 307, 304, 213, 295, 295, 100, 295, 295, + 193, 118, 58, 295, 295, 295, 295, 93, 295, 295, + 257, 316, 295, 295, 295, 311, 197, 309, 307, 304, + 213, 295, 295, 100, 295, 295, 193, 118, 54, 295, + 295, 295, 295, 93, 295, 295, 257, 316, 295, 295, + 295, 311, 197, 309, 295, 304, 295, 295, 307, 295, + 213, 295, 295, 100, 295, 295, 193, 118, 71, 295, + 295, 295, 295, 93, 295, 295, 257, 316, 295, 295, + 295, 311, 197, 309, 307, 304, 213, 295, 295, 100, + 295, 295, 193, 118, 65, 295, 295, 295, 295, 93, + 295, 295, 257, 316, 295, 295, 295, 311, 197, 309, + 307, 304, 213, 295, 295, 100, 295, 295, 193, 96, + 57, 295, 295, 295, 295, 93, 295, 295, 257, 316, + 295, 295, 295, 311, 197, 309, 295, 304, 295, 295, + 307, 295, 213, 295, 295, 100, 295, 295, 185, 106, + 53, 295, 295, 295, 295, 93, 295, 295, 257, 316, + 295, 295, 295, 311, 197, 309, 307, 304, 213, 295, + 295, 100, 295, 295, 193, 118, 60, 295, 295, 295, + 295, 93, 295, 295, 257, 316, 295, 295, 295, 311, + 197, 309, 307, 304, 213, 295, 295, 100, 295, 295, + 193, 118, 73, 295, 295, 295, 295, 93, 295, 295, + 257, 316, 295, 295, 295, 311, 197, 309, 295, 304, + 295, 295, 307, 295, 213, 295, 295, 100, 295, 295, + 193, 118, 55, 295, 295, 295, 295, 93, 295, 295, + 257, 316, 295, 295, 295, 311, 197, 309, 307, 304, + 213, 295, 295, 100, 295, 295, 193, 95, 68, 295, + 295, 295, 295, 93, 295, 295, 257, 316, 295, 295, + 295, 311, 197, 309, 307, 304, 213, 295, 295, 100, + 295, 295, 193, 118, 69, 295, 295, 295, 295, 93, + 295, 295, 257, 316, 295, 295, 295, 311, 197, 309, + 295, 304, 295, 295, 307, 295, 213, 295, 295, 100, + 295, 295, 193, 118, 51, 295, 295, 295, 295, 93, + 295, 295, 257, 316, 295, 295, 295, 311, 197, 309, + 307, 304, 213, 295, 295, 100, 295, 295, 184, 118, + 52, 295, 295, 295, 295, 93, 295, 295, 257, 316, + 295, 295, 295, 311, 197, 309, 307, 304, 213, 295, + 295, 100, 295, 295, 193, 118, 47, 295, 295, 295, + 295, 93, 295, 295, 257, 316, 295, 295, 295, 311, + 197, 309, 295, 304, 295, 295, 307, 295, 213, 295, + 295, 100, 295, 295, 193, 118, 50, 295, 295, 295, + 295, 93, 295, 295, 257, 316, 295, 295, 295, 311, + 197, 309, 307, 304, 213, 295, 295, 100, 295, 295, + 193, 118, 62, 295, 295, 295, 295, 93, 295, 295, + 257, 316, 295, 295, 295, 311, 197, 309, 307, 304, + 213, 295, 295, 100, 295, 295, 193, 118, 63, 295, + 295, 295, 295, 93, 295, 295, 257, 316, 295, 295, + 295, 311, 197, 309, 295, 304, 295, 295, 307, 295, + 213, 295, 295, 100, 295, 295, 193, 118, 61, 295, + 295, 295, 295, 93, 295, 295, 257, 316, 295, 295, + 295, 311, 197, 309, 307, 304, 213, 295, 295, 100, + 295, 295, 193, 118, 48, 295, 295, 295, 295, 93, + 295, 295, 257, 316, 391, 391, 391, 311, 197, 309, + 307, 304, 213, 295, 295, 100, 295, 295, 193, 118, + 72, 295, 295, 295, 295, 93, 295, 295, 257, 316, + 295, 295, 295, 311, 197, 309, 295, 304, 295, 295, + 425, 295, 391, 391, 295, 295, 295, 295, 307, 295, + 213, 425, 198, 100, 38, 295, 193, 112, 391, 391, + 391, 391, 38, 93, 295, 295, 295, 306, 295, 295, + 295, 311, 197, 309, 295, 304, 295, 35, 307, 33, + 213, 295, 295, 100, 295, 13, 193, 120, 295, 295, + 41, 36, 198, 93, 38, 295, 295, 231, 41, 36, + 295, 311, 197, 309, 295, 304, 319, 318, 315, 245, + 295, 207, 295, 295, 319, 318, 315, 245, 295, 33, + 454, 295, 295, 454, 295, 13, 207, 454, 438, 295, + 41, 36, 295, 295, 295, 454, 295, 295, 454, 295, + 295, 14, 454, 438, 295, 295, 319, 318, 315, 245, + 295, 198, 295, 38, 438, 295, 295, 438, 307, 454, + 213, 438, 320, 100, 295, 241, 193, 122, 295, 438, + 295, 295, 438, 93, 454, 295, 438, 295, 198, 295, + 38, 311, 197, 309, 295, 304, 307, 295, 213, 41, + 36, 100, 295, 295, 193, 117, 295, 295, 295, 295, + 295, 93, 295, 295, 295, 319, 318, 315, 245, 311, + 197, 309, 207, 304, 295, 295, 41, 36, 295, 295, + 295, 454, 295, 295, 454, 295, 295, 4, 454, 438, + 295, 295, 319, 318, 315, 245, 295, 294, 295, 295, + 295, 307, 295, 213, 295, 295, 100, 295, 295, 193, + 123, 295, 295, 295, 295, 438, 93, 295, 438, 141, + 454, 295, 438, 167, 311, 197, 309, 295, 304, 264, + 295, 295, 40, 20, 305, 295, 295, 307, 295, 213, + 295, 198, 100, 38, 295, 193, 116, 174, 307, 295, + 213, 295, 93, 100, 295, 295, 193, 113, 295, 295, + 311, 197, 309, 93, 304, 295, 198, 295, 38, 295, + 295, 311, 197, 309, 295, 304, 307, 295, 213, 41, + 36, 100, 295, 295, 193, 119, 295, 295, 295, 295, + 295, 93, 295, 321, 145, 319, 318, 315, 245, 311, + 197, 309, 207, 304, 41, 36, 295, 295, 295, 295, + 295, 454, 295, 295, 454, 295, 295, 295, 454, 438, + 319, 318, 315, 245, 198, 295, 38, 295, 198, 295, + 38, 295, 198, 295, 38, 295, 295, 295, 242, 295, + 295, 295, 285, 295, 295, 438, 171, 295, 438, 295, + 454, 295, 438, 295, 295, 295, 295, 454, 295, 295, + 454, 295, 41, 36, 454, 438, 41, 36, 295, 295, + 41, 36, 198, 295, 38, 295, 295, 295, 319, 318, + 315, 245, 319, 318, 315, 245, 319, 318, 315, 245, + 295, 438, 295, 147, 438, 295, 454, 167, 438, 295, + 295, 295, 295, 264, 295, 295, 40, 20, 305, 227, + 41, 36, 295, 295, 295, 295, 295, 295, 295, 295, + 295, 174, 295, 295, 295, 295, 319, 318, 315, 245, + 198, 295, 38, 295, 198, 295, 38, 142, 198, 295, + 38, 167, 295, 295, 173, 295, 295, 264, 295, 295, + 40, 20, 305, 295, 295, 295, 107, 295, 198, 29, + 38, 295, 198, 295, 38, 174, 295, 295, 41, 36, + 295, 295, 41, 36, 295, 244, 41, 36, 295, 295, + 295, 295, 295, 295, 319, 318, 315, 245, 319, 318, + 315, 245, 319, 318, 315, 245, 41, 36, 295, 295, + 41, 36, 295, 295, 295, 295, 295, 295, 295, 295, + 295, 295, 319, 318, 315, 245, 319, 318, 315, 245, + 198, 295, 295, 295, 295, 295, 295, 295, 295, 295, + 295, 295, 295, 295, 349, 295, 295, 295, 202, 295, + 295, 295, 295, 295, 295, 295, 295, 33, 295, 295, + 295, 295, 295, 13, 295, 295, 425, 295, 295, 295, + 295, 295, 295, 295, 295, 295, 295, 425, ); - static public $yy_lookahead = array( - 3, 13, 65, 70, 67, 11, 73, 13, 11, 12, - 13, 17, 15, 80, 17, 81, 19, 20, 21, 93, - 27, 2, 89, 26, 36, 92, 33, 30, 31, 32, - 11, 34, 13, 36, 35, 16, 17, 18, 41, 42, - 43, 44, 105, 46, 3, 48, 22, 50, 51, 52, - 53, 52, 11, 12, 13, 58, 15, 15, 17, 35, - 19, 20, 21, 44, 64, 2, 47, 26, 49, 93, - 51, 30, 31, 32, 11, 34, 13, 36, 36, 16, - 17, 18, 41, 42, 43, 44, 91, 46, 3, 48, - 17, 50, 51, 98, 53, 53, 11, 12, 13, 58, - 15, 23, 17, 100, 19, 20, 21, 44, 36, 2, - 47, 26, 49, 76, 51, 30, 31, 32, 11, 34, - 13, 36, 49, 45, 17, 18, 41, 42, 43, 44, - 52, 46, 3, 48, 80, 50, 51, 100, 53, 44, - 11, 12, 13, 58, 15, 23, 17, 52, 19, 20, - 21, 44, 98, 2, 47, 26, 49, 1, 51, 30, - 31, 32, 11, 34, 13, 36, 101, 45, 17, 18, - 41, 42, 43, 44, 2, 46, 3, 48, 81, 50, - 51, 59, 53, 27, 11, 12, 13, 58, 15, 33, - 17, 72, 19, 20, 21, 44, 9, 10, 47, 26, - 49, 82, 51, 30, 31, 32, 11, 34, 13, 36, - 1, 1, 17, 18, 41, 42, 43, 44, 44, 46, - 3, 48, 1, 50, 51, 51, 53, 18, 11, 12, - 13, 58, 15, 44, 17, 27, 19, 20, 21, 44, - 51, 33, 47, 26, 49, 76, 51, 30, 31, 32, - 15, 34, 17, 36, 85, 86, 87, 93, 41, 42, - 43, 44, 52, 46, 3, 48, 81, 50, 51, 100, - 53, 52, 11, 12, 13, 58, 15, 8, 17, 10, - 19, 20, 21, 48, 11, 50, 13, 26, 53, 69, - 17, 30, 31, 32, 13, 34, 15, 36, 17, 16, - 27, 18, 41, 42, 43, 44, 33, 46, 3, 48, - 50, 50, 51, 93, 53, 34, 11, 12, 13, 58, - 15, 11, 17, 13, 19, 20, 21, 17, 17, 16, - 47, 26, 36, 36, 53, 30, 31, 32, 13, 34, - 15, 36, 17, 47, 47, 69, 41, 42, 43, 44, - 50, 46, 3, 48, 24, 50, 51, 44, 53, 49, - 11, 12, 13, 58, 15, 11, 17, 13, 19, 20, - 21, 17, 96, 97, 35, 26, 37, 36, 53, 30, - 31, 32, 15, 34, 17, 36, 16, 16, 72, 18, - 41, 42, 43, 44, 91, 46, 3, 48, 82, 50, - 51, 98, 53, 49, 11, 12, 13, 58, 15, 11, - 17, 13, 19, 20, 21, 17, 100, 50, 47, 26, - 53, 76, 36, 30, 31, 32, 65, 34, 67, 36, - 44, 17, 72, 47, 41, 42, 43, 44, 52, 46, - 3, 48, 82, 50, 51, 100, 53, 49, 11, 12, - 13, 58, 15, 11, 17, 13, 19, 20, 21, 17, - 100, 1, 17, 26, 15, 104, 105, 30, 31, 32, - 29, 34, 18, 36, 35, 52, 37, 36, 41, 42, - 43, 44, 23, 46, 16, 48, 17, 50, 47, 29, - 53, 65, 66, 67, 68, 58, 70, 71, 44, 73, - 74, 75, 53, 15, 45, 51, 80, 76, 17, 83, - 84, 40, 44, 36, 88, 89, 90, 14, 92, 51, - 65, 66, 67, 68, 47, 70, 71, 1, 73, 74, - 75, 100, 101, 76, 94, 80, 96, 97, 83, 84, - 14, 53, 70, 88, 89, 90, 65, 92, 67, 77, - 78, 70, 80, 27, 73, 74, 75, 100, 72, 33, - 16, 80, 76, 34, 83, 84, 72, 23, 82, 88, - 89, 90, 65, 92, 67, 68, 82, 70, 71, 44, - 73, 74, 75, 102, 103, 14, 100, 80, 72, 95, - 83, 84, 14, 17, 16, 88, 89, 90, 82, 92, - 4, 5, 6, 7, 8, 27, 9, 11, 12, 13, - 35, 33, 37, 34, 36, 19, 20, 21, 15, 72, - 17, 17, 26, 76, 70, 47, 30, 31, 32, 82, - 65, 77, 67, 72, 80, 70, 17, 14, 73, 74, - 75, 17, 77, 82, 37, 80, 23, 100, 83, 84, - 27, 1, 15, 88, 89, 90, 33, 92, 17, 5, - 93, 93, 95, 95, 14, 11, 12, 13, 45, 15, - 96, 97, 70, 19, 20, 21, 65, 27, 67, 77, - 26, 5, 80, 33, 30, 31, 32, 11, 12, 13, - 72, 15, 1, 2, 76, 19, 20, 21, 18, 70, - 82, 79, 26, 85, 86, 87, 30, 31, 32, 80, - 97, 72, 58, 59, 65, 1, 67, 3, 100, 70, - 72, 82, 73, 74, 75, 82, 77, 47, 94, 80, - 82, 80, 83, 84, 58, 59, 22, 88, 89, 90, - 65, 92, 67, 95, 70, 70, 93, 73, 73, 74, - 75, 80, 38, 39, 80, 80, 96, 97, 83, 84, - 1, 61, 62, 88, 89, 90, 92, 92, 54, 55, - 56, 57, 65, 14, 67, 63, 64, 70, 103, 93, - 73, 74, 75, 80, 18, 14, 27, 80, 95, 93, - 83, 84, 33, 106, 23, 88, 89, 90, 27, 92, - 65, 93, 67, 106, 33, 70, 99, 106, 73, 74, - 75, 106, 106, 106, 106, 80, 45, 106, 83, 84, - 106, 106, 106, 88, 89, 90, 106, 92, 106, 106, - 65, 106, 67, 106, 99, 70, 106, 106, 73, 74, - 75, 106, 106, 106, 106, 80, 106, 106, 83, 84, - 106, 106, 106, 88, 89, 90, 106, 92, 106, 106, - 106, 65, 106, 67, 99, 106, 70, 106, 106, 73, - 74, 75, 106, 1, 106, 3, 80, 106, 106, 83, - 84, 106, 106, 106, 88, 89, 90, 106, 92, 65, - 106, 67, 106, 106, 70, 106, 106, 73, 74, 75, - 106, 106, 106, 106, 80, 106, 106, 83, 84, 106, - 38, 39, 88, 89, 90, 65, 92, 67, 106, 106, - 70, 106, 106, 73, 74, 75, 54, 55, 56, 57, - 80, 59, 106, 83, 84, 106, 106, 106, 88, 89, - 90, 106, 92, 106, 106, 65, 106, 67, 106, 106, - 70, 106, 106, 73, 74, 75, 106, 1, 106, 3, - 80, 106, 106, 83, 84, 106, 106, 106, 88, 89, - 90, 106, 92, 65, 106, 67, 106, 106, 70, 106, - 106, 73, 74, 75, 28, 106, 106, 106, 80, 106, - 106, 83, 84, 106, 38, 39, 88, 89, 90, 65, - 92, 67, 106, 106, 70, 106, 106, 73, 74, 75, - 54, 55, 56, 57, 80, 106, 106, 83, 84, 106, - 106, 106, 88, 89, 90, 106, 92, 106, 106, 65, - 106, 67, 106, 106, 70, 106, 106, 73, 74, 75, - 106, 1, 2, 3, 80, 106, 106, 83, 84, 106, - 106, 106, 88, 89, 90, 106, 92, 65, 106, 67, - 106, 106, 70, 106, 106, 73, 74, 75, 106, 106, - 106, 106, 80, 106, 106, 83, 84, 106, 38, 39, - 88, 89, 90, 65, 92, 67, 106, 106, 70, 106, - 106, 73, 74, 75, 54, 55, 56, 57, 80, 106, - 106, 83, 84, 106, 106, 106, 88, 89, 90, 106, - 92, 106, 106, 65, 106, 67, 106, 106, 70, 106, - 106, 73, 74, 75, 106, 1, 106, 3, 80, 106, - 106, 83, 84, 106, 106, 106, 88, 89, 90, 106, - 92, 65, 106, 67, 106, 106, 70, 106, 106, 73, - 74, 75, 106, 106, 106, 106, 80, 106, 106, 83, - 84, 37, 38, 39, 88, 89, 90, 65, 92, 67, - 106, 106, 70, 106, 106, 73, 74, 75, 54, 55, - 56, 57, 80, 106, 106, 83, 84, 106, 106, 106, - 88, 89, 90, 106, 92, 106, 106, 65, 106, 67, - 106, 106, 70, 106, 106, 73, 74, 75, 106, 1, - 106, 3, 80, 106, 106, 83, 84, 106, 106, 106, - 88, 89, 90, 106, 92, 65, 106, 67, 106, 106, - 70, 106, 106, 73, 74, 75, 106, 106, 106, 106, - 80, 106, 106, 83, 84, 37, 38, 39, 88, 89, - 90, 65, 92, 67, 106, 106, 70, 106, 106, 73, - 74, 75, 54, 55, 56, 57, 80, 106, 106, 83, - 84, 106, 106, 106, 88, 89, 90, 106, 92, 106, - 106, 65, 106, 67, 106, 106, 70, 106, 106, 73, - 74, 75, 106, 1, 106, 3, 80, 106, 106, 83, - 84, 106, 106, 106, 88, 89, 90, 106, 92, 65, - 106, 67, 106, 106, 70, 106, 106, 73, 74, 75, - 106, 106, 106, 106, 80, 106, 106, 83, 84, 106, - 38, 39, 88, 89, 90, 65, 92, 67, 106, 106, - 70, 106, 106, 73, 74, 75, 54, 55, 56, 57, - 80, 106, 106, 83, 84, 106, 106, 106, 88, 89, - 90, 106, 92, 106, 106, 65, 106, 67, 106, 106, - 70, 106, 106, 73, 74, 75, 106, 106, 106, 3, - 80, 106, 106, 83, 84, 106, 106, 106, 88, 89, - 90, 106, 92, 65, 106, 67, 106, 106, 70, 106, - 106, 73, 74, 75, 106, 106, 106, 106, 80, 106, - 106, 83, 84, 106, 38, 39, 88, 89, 90, 65, - 92, 67, 106, 106, 70, 106, 106, 73, 74, 75, - 54, 55, 56, 57, 80, 106, 106, 83, 84, 106, - 106, 106, 88, 89, 90, 106, 92, 106, 106, 65, - 106, 67, 106, 106, 70, 106, 106, 73, 74, 75, - 106, 106, 106, 106, 80, 106, 106, 83, 84, 106, - 106, 106, 88, 89, 90, 106, 92, 65, 106, 67, - 106, 106, 70, 106, 106, 73, 74, 75, 106, 106, - 106, 106, 80, 106, 106, 83, 84, 106, 106, 106, - 88, 89, 90, 65, 92, 67, 106, 106, 70, 106, - 106, 73, 74, 75, 106, 106, 106, 106, 80, 106, - 106, 83, 84, 106, 106, 106, 88, 89, 90, 106, - 92, 106, 106, 65, 106, 67, 106, 106, 70, 106, - 106, 73, 74, 75, 1, 2, 3, 106, 80, 106, - 106, 83, 84, 106, 106, 106, 88, 89, 90, 106, - 92, 65, 106, 67, 106, 106, 70, 106, 106, 73, - 74, 106, 106, 106, 106, 106, 80, 106, 106, 36, - 84, 38, 39, 106, 88, 89, 90, 1, 92, 3, - 47, 1, 106, 3, 106, 106, 106, 54, 55, 56, - 57, 106, 106, 106, 106, 106, 106, 65, 106, 67, - 106, 25, 70, 27, 106, 73, 74, 27, 106, 33, - 106, 106, 80, 33, 38, 39, 84, 106, 38, 39, - 88, 89, 90, 106, 92, 106, 106, 106, 106, 106, - 54, 55, 56, 57, 54, 55, 56, 57, 2, 106, - 106, 106, 106, 65, 106, 67, 106, 11, 70, 13, - 106, 73, 74, 17, 18, 106, 106, 106, 80, 106, - 106, 106, 106, 106, 106, 106, 88, 89, 90, 65, - 92, 67, 106, 1, 70, 3, 106, 73, 74, 106, - 44, 106, 106, 47, 80, 49, 14, 51, 52, 106, - 106, 106, 88, 89, 90, 106, 92, 65, 106, 67, - 106, 106, 70, 72, 106, 73, 74, 76, 106, 106, - 38, 39, 80, 82, 106, 106, 85, 86, 87, 106, - 88, 89, 90, 106, 92, 106, 54, 55, 56, 57, - 106, 100, 65, 106, 67, 106, 106, 70, 106, 106, - 73, 74, 106, 65, 106, 67, 106, 80, 70, 106, - 106, 73, 74, 106, 106, 88, 89, 90, 80, 92, - 106, 106, 106, 106, 106, 106, 88, 89, 90, 106, - 92, 65, 1, 67, 3, 106, 70, 106, 106, 73, - 74, 106, 106, 106, 106, 106, 80, 106, 106, 106, - 106, 106, 106, 106, 88, 89, 90, 106, 92, 106, - 1, 72, 3, 106, 1, 76, 3, 106, 106, 38, - 39, 82, 106, 14, 85, 86, 87, 14, 106, 106, - 106, 106, 106, 52, 106, 54, 55, 56, 57, 100, - 1, 106, 3, 106, 1, 106, 3, 38, 39, 106, - 106, 38, 39, 14, 106, 106, 106, 14, 106, 106, - 106, 106, 106, 54, 55, 56, 57, 54, 55, 56, - 57, 106, 106, 106, 106, 106, 106, 38, 39, 106, - 106, 38, 39, 106, 106, 106, 106, 106, 106, 106, - 106, 106, 106, 54, 55, 56, 57, 54, 55, 56, - 57, 106, 1, 106, 106, 106, 106, 106, 14, 106, - 106, 106, 106, 106, 106, 14, 22, 106, 24, 18, - 106, 27, 106, 106, 106, 106, 106, 33, 27, 35, - 106, 37, 106, 11, 33, 13, 106, 36, 44, 17, - 106, 106, 106, 106, 106, 106, 106, 106, 47, 27, - 106, 29, 106, 106, 106, 33, + static public $yy_lookahead = array( + 3, 9, 10, 15, 71, 17, 28, 74, 11, 12, + 13, 14, 34, 16, 81, 18, 28, 20, 21, 22, + 11, 82, 34, 14, 27, 37, 93, 18, 31, 32, + 33, 45, 35, 66, 37, 68, 48, 28, 52, 42, + 43, 44, 45, 34, 47, 15, 49, 16, 51, 52, + 53, 54, 3, 23, 77, 25, 59, 17, 28, 19, + 11, 12, 13, 14, 34, 16, 36, 18, 38, 20, + 21, 22, 105, 106, 94, 45, 27, 73, 101, 73, + 31, 32, 33, 77, 35, 54, 37, 83, 48, 83, + 65, 42, 43, 44, 45, 14, 47, 16, 49, 18, + 51, 52, 3, 54, 36, 101, 38, 101, 59, 15, + 11, 12, 13, 14, 77, 16, 35, 18, 24, 20, + 21, 22, 28, 86, 87, 88, 27, 24, 34, 73, + 31, 32, 33, 77, 35, 54, 37, 36, 101, 83, + 46, 42, 43, 44, 45, 16, 47, 70, 49, 46, + 51, 52, 3, 54, 53, 81, 53, 101, 59, 15, + 11, 12, 13, 14, 23, 16, 37, 18, 24, 20, + 21, 22, 28, 99, 97, 98, 27, 36, 34, 82, + 31, 32, 33, 54, 35, 71, 37, 16, 74, 18, + 46, 42, 43, 44, 45, 81, 47, 45, 49, 77, + 51, 52, 3, 54, 90, 53, 18, 93, 59, 30, + 11, 12, 13, 14, 101, 16, 37, 18, 24, 20, + 21, 22, 51, 101, 102, 54, 27, 48, 1, 17, + 31, 32, 33, 24, 35, 14, 37, 16, 50, 18, + 46, 42, 43, 44, 45, 1, 47, 36, 49, 38, + 51, 52, 3, 54, 60, 46, 1, 45, 59, 15, + 11, 12, 13, 14, 52, 16, 8, 18, 10, 20, + 21, 22, 28, 97, 98, 54, 27, 36, 34, 38, + 31, 32, 33, 28, 35, 95, 37, 97, 98, 34, + 2, 42, 43, 44, 45, 1, 47, 71, 49, 102, + 51, 52, 3, 54, 78, 79, 73, 81, 59, 15, + 11, 12, 13, 14, 71, 16, 83, 18, 17, 20, + 21, 22, 28, 19, 81, 24, 27, 73, 34, 96, + 31, 32, 33, 17, 35, 19, 37, 83, 1, 2, + 17, 42, 43, 44, 45, 1, 47, 71, 49, 45, + 51, 52, 3, 54, 78, 101, 52, 81, 59, 15, + 11, 12, 13, 14, 48, 16, 45, 18, 45, 20, + 21, 22, 28, 52, 14, 16, 27, 18, 34, 37, + 31, 32, 33, 66, 35, 68, 37, 45, 64, 65, + 48, 42, 43, 44, 45, 53, 47, 37, 49, 71, + 51, 52, 3, 54, 73, 37, 78, 37, 59, 81, + 11, 12, 13, 14, 83, 16, 48, 18, 48, 20, + 21, 22, 11, 106, 37, 14, 27, 96, 1, 18, + 31, 32, 33, 1, 35, 48, 37, 73, 1, 73, + 16, 42, 43, 44, 45, 73, 47, 83, 49, 83, + 51, 52, 3, 54, 73, 83, 19, 30, 59, 77, + 11, 12, 13, 14, 83, 16, 70, 18, 28, 20, + 21, 22, 11, 94, 34, 14, 27, 82, 54, 18, + 31, 32, 33, 101, 35, 53, 37, 94, 45, 96, + 94, 42, 43, 44, 45, 66, 47, 68, 49, 92, + 51, 52, 3, 54, 19, 77, 99, 94, 59, 96, + 11, 12, 13, 14, 38, 16, 37, 18, 92, 20, + 21, 22, 62, 63, 18, 99, 27, 97, 98, 101, + 31, 32, 33, 48, 35, 16, 37, 25, 16, 51, + 18, 42, 43, 44, 45, 37, 47, 18, 49, 18, + 51, 41, 9, 54, 53, 53, 15, 18, 59, 66, + 67, 68, 69, 2, 71, 72, 18, 74, 75, 76, + 18, 49, 11, 51, 81, 14, 54, 84, 85, 18, + 19, 18, 89, 90, 91, 18, 93, 4, 5, 6, + 7, 8, 18, 35, 11, 12, 13, 14, 17, 15, + 18, 35, 81, 20, 21, 22, 45, 51, 19, 48, + 27, 50, 94, 52, 31, 32, 33, 66, 67, 68, + 69, 83, 71, 72, 80, 74, 75, 76, 95, 94, + 81, 94, 81, 107, 94, 84, 85, 107, 96, 94, + 89, 90, 91, 81, 93, 66, 107, 68, 98, 107, + 71, 107, 107, 74, 75, 76, 107, 107, 107, 107, + 81, 107, 107, 84, 85, 107, 107, 107, 89, 90, + 91, 66, 93, 68, 69, 107, 71, 72, 107, 74, + 75, 76, 103, 104, 107, 11, 81, 107, 14, 84, + 85, 107, 18, 107, 89, 90, 91, 107, 93, 107, + 5, 107, 107, 107, 107, 107, 11, 12, 13, 14, + 107, 16, 107, 107, 107, 20, 21, 22, 11, 107, + 107, 14, 27, 5, 50, 18, 31, 32, 33, 11, + 12, 13, 14, 107, 16, 28, 107, 30, 20, 21, + 22, 34, 107, 107, 107, 27, 107, 107, 107, 31, + 32, 33, 107, 107, 59, 60, 66, 107, 68, 107, + 107, 71, 107, 107, 74, 75, 76, 107, 107, 107, + 107, 81, 107, 107, 84, 85, 107, 59, 60, 89, + 90, 91, 66, 93, 68, 107, 11, 71, 107, 14, + 74, 75, 76, 18, 104, 11, 107, 81, 14, 107, + 84, 85, 18, 107, 107, 89, 90, 91, 107, 93, + 107, 107, 66, 107, 68, 107, 100, 71, 107, 107, + 74, 75, 76, 107, 107, 50, 107, 81, 107, 107, + 84, 85, 107, 107, 50, 89, 90, 91, 107, 93, + 107, 107, 66, 107, 68, 107, 100, 71, 107, 107, + 74, 75, 76, 107, 107, 107, 107, 81, 107, 107, + 84, 85, 107, 107, 107, 89, 90, 91, 107, 93, + 107, 107, 66, 107, 68, 107, 100, 71, 107, 107, + 74, 75, 76, 107, 78, 107, 107, 81, 107, 107, + 84, 85, 107, 107, 107, 89, 90, 91, 66, 93, + 68, 107, 107, 71, 107, 107, 74, 75, 76, 107, + 78, 107, 107, 81, 107, 107, 84, 85, 107, 107, + 107, 89, 90, 91, 66, 93, 68, 107, 107, 71, + 107, 107, 74, 75, 76, 107, 107, 107, 107, 81, + 107, 107, 84, 85, 107, 107, 107, 89, 90, 91, + 107, 93, 107, 107, 66, 107, 68, 107, 107, 71, + 107, 107, 74, 75, 76, 107, 107, 107, 107, 81, + 107, 107, 84, 85, 107, 107, 107, 89, 90, 91, + 66, 93, 68, 107, 107, 71, 107, 107, 74, 75, + 76, 107, 107, 107, 107, 81, 107, 107, 84, 85, + 107, 107, 107, 89, 90, 91, 66, 93, 68, 107, + 107, 71, 107, 107, 74, 75, 76, 107, 107, 107, + 107, 81, 107, 107, 84, 85, 107, 107, 107, 89, + 90, 91, 107, 93, 107, 107, 66, 107, 68, 107, + 107, 71, 107, 107, 74, 75, 76, 107, 107, 107, + 107, 81, 107, 107, 84, 85, 107, 107, 107, 89, + 90, 91, 66, 93, 68, 107, 107, 71, 107, 107, + 74, 75, 76, 107, 107, 107, 107, 81, 107, 107, + 84, 85, 107, 107, 107, 89, 90, 91, 66, 93, + 68, 107, 107, 71, 107, 107, 74, 75, 76, 107, + 107, 107, 107, 81, 107, 107, 84, 85, 107, 107, + 107, 89, 90, 91, 107, 93, 107, 107, 66, 107, + 68, 107, 107, 71, 107, 107, 74, 75, 76, 107, + 107, 107, 107, 81, 107, 107, 84, 85, 107, 107, + 107, 89, 90, 91, 66, 93, 68, 107, 107, 71, + 107, 107, 74, 75, 76, 107, 107, 107, 107, 81, + 107, 107, 84, 85, 107, 107, 107, 89, 90, 91, + 66, 93, 68, 107, 107, 71, 107, 107, 74, 75, + 76, 107, 107, 107, 107, 81, 107, 107, 84, 85, + 107, 107, 107, 89, 90, 91, 107, 93, 107, 107, + 66, 107, 68, 107, 107, 71, 107, 107, 74, 75, + 76, 107, 107, 107, 107, 81, 107, 107, 84, 85, + 107, 107, 107, 89, 90, 91, 66, 93, 68, 107, + 107, 71, 107, 107, 74, 75, 76, 107, 107, 107, + 107, 81, 107, 107, 84, 85, 107, 107, 107, 89, + 90, 91, 66, 93, 68, 107, 107, 71, 107, 107, + 74, 75, 76, 107, 107, 107, 107, 81, 107, 107, + 84, 85, 107, 107, 107, 89, 90, 91, 107, 93, + 107, 107, 66, 107, 68, 107, 107, 71, 107, 107, + 74, 75, 76, 107, 107, 107, 107, 81, 107, 107, + 84, 85, 107, 107, 107, 89, 90, 91, 66, 93, + 68, 107, 107, 71, 107, 107, 74, 75, 76, 107, + 107, 107, 107, 81, 107, 107, 84, 85, 107, 107, + 107, 89, 90, 91, 66, 93, 68, 107, 107, 71, + 107, 107, 74, 75, 76, 107, 107, 107, 107, 81, + 107, 107, 84, 85, 107, 107, 107, 89, 90, 91, + 107, 93, 107, 107, 66, 107, 68, 107, 107, 71, + 107, 107, 74, 75, 76, 107, 107, 107, 107, 81, + 107, 107, 84, 85, 107, 107, 107, 89, 90, 91, + 66, 93, 68, 107, 107, 71, 107, 107, 74, 75, + 76, 107, 107, 107, 107, 81, 107, 107, 84, 85, + 107, 107, 107, 89, 90, 91, 66, 93, 68, 107, + 107, 71, 107, 107, 74, 75, 76, 107, 107, 107, + 107, 81, 107, 107, 84, 85, 107, 107, 107, 89, + 90, 91, 107, 93, 107, 107, 66, 107, 68, 107, + 107, 71, 107, 107, 74, 75, 76, 107, 107, 107, + 107, 81, 107, 107, 84, 85, 107, 107, 107, 89, + 90, 91, 66, 93, 68, 107, 107, 71, 107, 107, + 74, 75, 76, 107, 107, 107, 107, 81, 107, 107, + 84, 85, 107, 107, 107, 89, 90, 91, 66, 93, + 68, 107, 107, 71, 107, 107, 74, 75, 76, 107, + 107, 107, 107, 81, 107, 107, 84, 85, 107, 107, + 107, 89, 90, 91, 107, 93, 107, 107, 66, 107, + 68, 107, 107, 71, 107, 107, 74, 75, 76, 107, + 107, 107, 107, 81, 107, 107, 84, 85, 107, 107, + 107, 89, 90, 91, 66, 93, 68, 107, 107, 71, + 107, 107, 74, 75, 76, 107, 107, 107, 107, 81, + 107, 107, 84, 85, 1, 2, 3, 89, 90, 91, + 66, 93, 68, 107, 107, 71, 107, 107, 74, 75, + 76, 107, 107, 107, 107, 81, 107, 107, 84, 85, + 107, 107, 107, 89, 90, 91, 107, 93, 107, 107, + 37, 107, 39, 40, 107, 107, 107, 107, 66, 107, + 68, 48, 1, 71, 3, 107, 74, 75, 55, 56, + 57, 58, 3, 81, 107, 107, 107, 85, 107, 107, + 107, 89, 90, 91, 107, 93, 107, 26, 66, 28, + 68, 107, 107, 71, 107, 34, 74, 75, 107, 107, + 39, 40, 1, 81, 3, 107, 107, 85, 39, 40, + 107, 89, 90, 91, 107, 93, 55, 56, 57, 58, + 107, 2, 107, 107, 55, 56, 57, 58, 107, 28, + 11, 107, 107, 14, 107, 34, 2, 18, 19, 107, + 39, 40, 107, 107, 107, 11, 107, 107, 14, 107, + 107, 17, 18, 19, 107, 107, 55, 56, 57, 58, + 107, 1, 107, 3, 45, 107, 107, 48, 66, 50, + 68, 52, 53, 71, 107, 15, 74, 75, 107, 45, + 107, 107, 48, 81, 50, 107, 52, 107, 1, 107, + 3, 89, 90, 91, 107, 93, 66, 107, 68, 39, + 40, 71, 107, 107, 74, 75, 107, 107, 107, 107, + 107, 81, 107, 107, 107, 55, 56, 57, 58, 89, + 90, 91, 2, 93, 107, 107, 39, 40, 107, 107, + 107, 11, 107, 107, 14, 107, 107, 17, 18, 19, + 107, 107, 55, 56, 57, 58, 107, 60, 107, 107, + 107, 66, 107, 68, 107, 107, 71, 107, 107, 74, + 75, 107, 107, 107, 107, 45, 81, 107, 48, 73, + 50, 107, 52, 77, 89, 90, 91, 107, 93, 83, + 107, 107, 86, 87, 88, 107, 107, 66, 107, 68, + 107, 1, 71, 3, 107, 74, 75, 101, 66, 107, + 68, 107, 81, 71, 107, 107, 74, 75, 107, 107, + 89, 90, 91, 81, 93, 107, 1, 107, 3, 107, + 107, 89, 90, 91, 107, 93, 66, 107, 68, 39, + 40, 71, 107, 107, 74, 75, 107, 107, 107, 107, + 107, 81, 107, 53, 29, 55, 56, 57, 58, 89, + 90, 91, 2, 93, 39, 40, 107, 107, 107, 107, + 107, 11, 107, 107, 14, 107, 107, 107, 18, 19, + 55, 56, 57, 58, 1, 107, 3, 107, 1, 107, + 3, 107, 1, 107, 3, 107, 107, 107, 15, 107, + 107, 107, 15, 107, 107, 45, 15, 107, 48, 107, + 50, 107, 52, 107, 107, 107, 107, 11, 107, 107, + 14, 107, 39, 40, 18, 19, 39, 40, 107, 107, + 39, 40, 1, 107, 3, 107, 107, 107, 55, 56, + 57, 58, 55, 56, 57, 58, 55, 56, 57, 58, + 107, 45, 107, 73, 48, 107, 50, 77, 52, 107, + 107, 107, 107, 83, 107, 107, 86, 87, 88, 38, + 39, 40, 107, 107, 107, 107, 107, 107, 107, 107, + 107, 101, 107, 107, 107, 107, 55, 56, 57, 58, + 1, 107, 3, 107, 1, 107, 3, 73, 1, 107, + 3, 77, 107, 107, 15, 107, 107, 83, 107, 107, + 86, 87, 88, 107, 107, 107, 23, 107, 1, 2, + 3, 107, 1, 107, 3, 101, 107, 107, 39, 40, + 107, 107, 39, 40, 107, 38, 39, 40, 107, 107, + 107, 107, 107, 107, 55, 56, 57, 58, 55, 56, + 57, 58, 55, 56, 57, 58, 39, 40, 107, 107, + 39, 40, 107, 107, 107, 107, 107, 107, 107, 107, + 107, 107, 55, 56, 57, 58, 55, 56, 57, 58, + 1, 107, 107, 107, 107, 107, 107, 107, 107, 107, + 107, 107, 107, 107, 15, 107, 107, 107, 19, 107, + 107, 107, 107, 107, 107, 107, 107, 28, 107, 107, + 107, 107, 107, 34, 107, 107, 37, 107, 107, 107, + 107, 107, 107, 107, 107, 107, 107, 48, ); - static public $yy_shift_ofst = array( - -13, 393, 393, 305, 85, 85, 85, 85, 349, 305, - 349, -3, 85, 85, 129, 85, 217, 85, 173, 85, - 85, 85, 129, 261, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 41, 41, 437, 437, - 437, 437, 437, 437, 1586, 1590, 1590, 1040, 1843, 1839, - 1208, 1124, 1781, 1682, 714, 956, 1813, 872, 1809, 1292, - 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, - 1292, 1292, 1376, 1376, 235, 676, 1901, 367, 156, 42, - 654, 1922, 273, 42, 371, 42, 156, 454, 156, 691, - 596, 63, 325, 759, 650, 398, 526, -6, 283, -6, - 680, 209, 210, -7, 603, 603, 460, 208, -7, 488, - -7, 221, 221, 766, 221, 221, 766, 221, 221, 221, - -13, -13, -13, -13, 1646, 19, 107, 151, 195, 281, - 310, 442, 468, -7, -7, -7, -7, 174, 174, 544, - -7, 174, 174, -7, -12, 449, 449, -7, 174, -7, - 174, 189, -7, 174, -7, -7, -7, -7, 189, 174, - 766, 766, 766, 221, 221, 172, 221, 221, 172, 72, - 221, -13, -13, -13, -13, -13, -13, 1543, 1894, 578, - 623, 771, 354, 386, 441, 78, 122, -1, 95, 296, - 73, 339, 297, 477, 313, 459, 24, 439, 575, 269, - 187, 641, 604, 597, 576, 529, 535, 619, 260, 571, - 607, 637, 624, 579, 503, 491, 370, 330, 300, 219, - 311, 341, 414, 471, 469, 423, 72, 445, + static public $yy_shift_ofst = array( + -23, 399, 399, 349, 99, 449, 449, 99, 349, 99, + 99, -3, 99, 99, 249, 99, 99, 99, 99, 299, + 99, 149, 199, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 299, 99, 99, 49, 49, 499, 499, + 499, 499, 499, 499, 1621, 1661, 1661, 1981, 2067, 2039, + 2047, 2043, 1747, 1850, 1720, 1941, 1937, 1875, 1933, 2071, + 2071, 2071, 2071, 2071, 2071, 2071, 2071, 2071, 2071, 2071, + 2071, 2071, 1629, 1629, 522, 695, 2129, 171, 255, 129, + 718, 707, 9, 255, 316, 255, 129, 129, 304, 337, + 583, 1780, 244, 784, 221, 344, 294, 411, 40, 411, + 485, 359, 440, -22, -22, 427, 432, 424, -22, 359, + 437, 589, 227, 227, 227, 589, 227, 227, 227, 227, + -23, -23, -23, -23, 1679, 1694, 561, 1910, 1956, 81, + 674, 212, 461, -22, -22, -22, -14, -14, -22, 360, + -22, -22, -22, -22, -14, 31, 321, -22, -22, 301, + 321, -14, -14, -14, 31, -22, -22, -22, -14, -14, + 589, 589, 227, 508, 589, 288, 227, 227, 288, 227, + 227, -23, -23, -23, -23, -23, -23, 1573, 30, -12, + 94, 144, 775, 342, 194, 103, 179, 258, 211, 141, + 152, 68, 241, 209, 323, 387, 370, 368, 188, -8, + 101, 556, 567, 563, 552, 539, 548, 574, 443, 558, + 566, 582, 581, 584, 541, 543, 512, 519, 506, 476, + 479, 488, 508, 502, 501, 531, 529, 510, ); static public $yy_reduce_ofst = array( - 700, 455, 426, 481, 507, 765, 707, 735, 565, 675, - 649, 1076, 1160, 1186, 1102, 1244, 964, 992, 1018, 1048, - 1216, 1438, 1468, 1384, 1412, 1270, 1300, 1354, 1328, 1132, - 824, 934, 908, 880, 850, 796, 1496, 1542, 1642, 1614, - 1677, 1716, 1688, 1588, 1739, 1641, 618, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, -67, 361, 486, 674, 547, 472, - -63, 494, 648, 602, 276, 554, 316, 440, 360, 431, - 611, 220, 54, 37, 37, 568, 37, 567, 574, 568, - 574, 345, 37, 119, 303, -5, 37, 561, 516, 629, - 639, 37, 37, 574, 37, 37, 660, 457, 37, 37, - 37, 37, 712, 37, 686, 686, 686, 686, 686, 703, - 693, 686, 686, 643, 643, 643, 643, 634, 634, 622, - 643, 634, 634, 643, 653, 671, 651, 643, 634, 643, - 634, 696, 643, 634, 643, 643, 643, 643, 708, 634, - 613, 613, 613, 3, 3, 65, 3, 3, 65, 164, - 3, 97, 185, 0, -24, -66, -74, + 460, 493, 551, 579, 605, 832, 806, 776, 690, 746, + 716, 1134, 1216, 1242, 1160, 1298, 1022, 1052, 1078, 1104, + 1268, 1488, 1514, 1432, 1462, 1324, 1350, 1406, 1380, 1186, + 888, 996, 970, 940, 914, 858, 1552, 1582, 1745, 1690, + 1781, 1820, 1792, 1662, 1974, 1930, 1756, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 114, -33, 6, -67, 56, 226, + 317, 233, 331, 254, 77, 4, 276, 328, 190, 122, + 429, 396, -23, 393, 74, -23, -23, 393, 176, 413, + 176, 407, 381, 366, 364, -23, -23, 243, 372, 426, + 428, 430, -23, -23, 382, 176, -23, -23, -23, -23, + -23, 324, -23, -23, 537, 537, 537, 537, 537, 549, + 542, 537, 537, 538, 538, 538, 533, 533, 538, 540, + 538, 538, 538, 538, 533, 521, 518, 538, 538, 544, + 535, 533, 533, 533, 562, 538, 538, 538, 533, 533, + 550, 550, 113, 545, 550, 197, 113, 113, 197, 113, + 113, 379, 395, -20, 97, -61, 25, ); static public $yyExpectedTokens = array( array(), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 52, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 53, 58,), - array(3, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 41, 42, 43, 44, 46, 48, 50, 53, 58,), - array(1, 3, 25, 27, 33, 38, 39, 54, 55, 56, 57,), - array(1, 3, 27, 33, 38, 39, 54, 55, 56, 57,), - array(1, 3, 27, 33, 38, 39, 54, 55, 56, 57,), - array(1, 2, 3, 38, 39, 54, 55, 56, 57,), - array(1, 3, 14, 38, 39, 54, 55, 56, 57,), - array(1, 3, 14, 38, 39, 54, 55, 56, 57,), - array(1, 3, 37, 38, 39, 54, 55, 56, 57,), - array(1, 3, 37, 38, 39, 54, 55, 56, 57,), - array(1, 3, 38, 39, 52, 54, 55, 56, 57,), - array(1, 3, 14, 38, 39, 54, 55, 56, 57,), - array(1, 3, 22, 38, 39, 54, 55, 56, 57,), - array(1, 3, 28, 38, 39, 54, 55, 56, 57,), - array(1, 3, 14, 38, 39, 54, 55, 56, 57,), - array(1, 3, 38, 39, 54, 55, 56, 57, 59,), - array(1, 3, 14, 38, 39, 54, 55, 56, 57,), - array(1, 3, 38, 39, 54, 55, 56, 57,), - array(1, 3, 38, 39, 54, 55, 56, 57,), - array(1, 3, 38, 39, 54, 55, 56, 57,), - array(1, 3, 38, 39, 54, 55, 56, 57,), - array(1, 3, 38, 39, 54, 55, 56, 57,), - array(1, 3, 38, 39, 54, 55, 56, 57,), - array(1, 3, 38, 39, 54, 55, 56, 57,), - array(1, 3, 38, 39, 54, 55, 56, 57,), - array(1, 3, 38, 39, 54, 55, 56, 57,), - array(1, 3, 38, 39, 54, 55, 56, 57,), - array(1, 3, 38, 39, 54, 55, 56, 57,), - array(1, 3, 38, 39, 54, 55, 56, 57,), - array(1, 3, 38, 39, 54, 55, 56, 57,), - array(3, 38, 39, 54, 55, 56, 57,), - array(3, 38, 39, 54, 55, 56, 57,), - array(15, 17, 48, 50, 53,), - array(5, 11, 12, 13, 15, 19, 20, 21, 26, 30, 31, 32, 58, 59,), - array(1, 14, 18, 27, 33, 36, 47,), - array(15, 17, 50, 53,), - array(1, 27, 33,), - array(15, 36, 53,), - array(5, 11, 12, 13, 15, 19, 20, 21, 26, 30, 31, 32, 58, 59,), - array(11, 13, 17, 27, 29, 33,), - array(11, 13, 17, 27, 33,), - array(15, 36, 53,), - array(16, 18, 47,), - array(15, 36, 53,), - array(1, 27, 33,), - array(18, 44, 51,), - array(1, 27, 33,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 53, 54, + 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 54, 59,), + array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 54, 59,), + array(1, 3, 26, 28, 34, 39, 40, 55, 56, 57, 58,), + array(1, 3, 28, 34, 39, 40, 55, 56, 57, 58,), + array(1, 3, 28, 34, 39, 40, 55, 56, 57, 58,), + array(1, 3, 38, 39, 40, 55, 56, 57, 58,), + array(1, 2, 3, 39, 40, 55, 56, 57, 58,), + array(1, 3, 15, 39, 40, 55, 56, 57, 58,), + array(1, 3, 38, 39, 40, 55, 56, 57, 58,), + array(1, 3, 23, 39, 40, 55, 56, 57, 58,), + array(1, 3, 39, 40, 55, 56, 57, 58, 60,), + array(1, 3, 39, 40, 53, 55, 56, 57, 58,), + array(1, 3, 15, 39, 40, 55, 56, 57, 58,), + array(1, 3, 15, 39, 40, 55, 56, 57, 58,), + array(1, 3, 15, 39, 40, 55, 56, 57, 58,), + array(1, 3, 29, 39, 40, 55, 56, 57, 58,), + array(1, 3, 15, 39, 40, 55, 56, 57, 58,), + array(1, 3, 39, 40, 55, 56, 57, 58,), + array(1, 3, 39, 40, 55, 56, 57, 58,), + array(1, 3, 39, 40, 55, 56, 57, 58,), + array(1, 3, 39, 40, 55, 56, 57, 58,), + array(1, 3, 39, 40, 55, 56, 57, 58,), + array(1, 3, 39, 40, 55, 56, 57, 58,), + array(1, 3, 39, 40, 55, 56, 57, 58,), + array(1, 3, 39, 40, 55, 56, 57, 58,), + array(1, 3, 39, 40, 55, 56, 57, 58,), + array(1, 3, 39, 40, 55, 56, 57, 58,), + array(1, 3, 39, 40, 55, 56, 57, 58,), + array(1, 3, 39, 40, 55, 56, 57, 58,), + array(1, 3, 39, 40, 55, 56, 57, 58,), + array(3, 39, 40, 55, 56, 57, 58,), + array(3, 39, 40, 55, 56, 57, 58,), + array(16, 18, 49, 51, 54,), + array(5, 11, 12, 13, 14, 16, 20, 21, 22, 27, 31, 32, 33, 59, 60,), + array(1, 15, 19, 28, 34, 37, 48,), + array(16, 18, 51, 54,), + array(1, 28, 34,), + array(16, 37, 54,), + array(5, 11, 12, 13, 14, 16, 20, 21, 22, 27, 31, 32, 33, 59, 60,), + array(11, 14, 18, 28, 30, 34,), + array(11, 14, 18, 28, 34,), + array(1, 28, 34,), + array(17, 19, 48,), + array(1, 28, 34,), + array(16, 37, 54,), + array(16, 37, 54,), + array(19, 45, 52,), array(1, 2,), - array(4, 5, 6, 7, 8, 11, 12, 13, 19, 20, 21, 26, 30, 31, 32,), - array(2, 11, 13, 16, 17, 18, 44, 47, 49, 51,), - array(13, 15, 17, 53,), - array(1, 14, 27, 33,), - array(1, 14, 27, 33,), - array(11, 13, 17, 49,), - array(1, 14, 27, 33,), - array(11, 13, 17,), - array(16, 18, 47,), - array(11, 13, 17,), - array(18, 47,), - array(1, 18,), - array(1, 52,), - array(27, 33,), - array(15, 17,), - array(15, 17,), - array(1, 29,), - array(27, 33,), - array(27, 33,), - array(15, 53,), - array(27, 33,), + array(4, 5, 6, 7, 8, 11, 12, 13, 14, 20, 21, 22, 27, 31, 32, 33,), + array(2, 11, 14, 17, 18, 19, 45, 48, 50, 52,), + array(1, 15, 28, 34,), + array(11, 14, 18, 50,), + array(14, 16, 18, 54,), + array(1, 15, 28, 34,), + array(1, 15, 28, 34,), + array(11, 14, 18,), + array(17, 19, 48,), + array(11, 14, 18,), + array(19, 48,), + array(16, 18,), + array(28, 34,), + array(28, 34,), + array(28, 34,), + array(1, 30,), + array(1, 53,), + array(16, 54,), + array(28, 34,), + array(16, 18,), + array(1, 19,), + array(19,), array(1,), array(1,), - array(18,), array(1,), + array(19,), array(1,), - array(18,), array(1,), array(1,), array(1,), @@ -665,110 +812,111 @@ class Smarty_Internal_Templateparser array(), array(), array(), - array(2, 11, 13, 17, 18, 44, 47, 49, 51, 52,), - array(2, 11, 13, 16, 17, 18, 44, 47, 49, 51,), - array(2, 11, 13, 17, 18, 44, 47, 49, 51,), - array(2, 11, 13, 17, 18, 44, 47, 49, 51,), - array(11, 13, 17, 18, 44, 47, 49, 51,), - array(13, 15, 17, 34, 53,), - array(11, 13, 17, 49,), - array(11, 13, 17,), - array(16, 44, 51,), - array(27, 33,), - array(27, 33,), - array(27, 33,), - array(27, 33,), - array(44, 51,), - array(44, 51,), - array(16, 23,), - array(27, 33,), - array(44, 51,), - array(44, 51,), - array(27, 33,), - array(13, 36,), - array(15, 53,), - array(15, 53,), - array(27, 33,), - array(44, 51,), - array(27, 33,), - array(44, 51,), - array(44, 51,), - array(27, 33,), - array(44, 51,), - array(27, 33,), - array(27, 33,), - array(27, 33,), - array(27, 33,), - array(44, 51,), - array(44, 51,), - array(18,), - array(18,), - array(18,), + array(2, 11, 14, 18, 19, 45, 48, 50, 52, 53,), + array(2, 11, 14, 17, 18, 19, 45, 48, 50, 52,), + array(2, 11, 14, 18, 19, 45, 48, 50, 52,), + array(2, 11, 14, 18, 19, 45, 48, 50, 52,), + array(11, 14, 18, 19, 45, 48, 50, 52,), + array(14, 16, 18, 35, 54,), + array(11, 14, 18, 50,), + array(17, 45, 52,), + array(11, 14, 18,), + array(28, 34,), + array(28, 34,), + array(28, 34,), + array(45, 52,), + array(45, 52,), + array(28, 34,), + array(14, 37,), + array(28, 34,), + array(28, 34,), + array(28, 34,), + array(28, 34,), + array(45, 52,), + array(16, 54,), + array(45, 52,), + array(28, 34,), + array(28, 34,), + array(17, 24,), + array(45, 52,), + array(45, 52,), + array(45, 52,), + array(45, 52,), + array(16, 54,), + array(28, 34,), + array(28, 34,), + array(28, 34,), + array(45, 52,), + array(45, 52,), + array(19,), + array(19,), array(1,), - array(1,), - array(2,), - array(1,), - array(1,), - array(2,), - array(36,), - array(1,), - array(), - array(), - array(), - array(), - array(), - array(), - array(1, 2, 3, 36, 38, 39, 47, 54, 55, 56, 57,), - array(14, 22, 24, 27, 33, 35, 37, 44,), - array(14, 16, 27, 33, 36, 47,), - array(14, 23, 27, 33, 45,), - array(14, 23, 27, 33, 45,), - array(11, 13, 17, 49,), - array(36, 44, 47, 52,), - array(29, 36, 47,), - array(23, 45, 52,), - array(23, 45, 59,), - array(35, 52,), - array(44, 52,), - array(36, 47,), - array(17, 49,), - array(35, 37,), - array(36, 47,), - array(36, 47,), - array(16, 44,), - array(23, 45,), - array(22, 35,), - array(35, 37,), - array(35, 37,), - array(8, 10,), - array(9, 10,), - array(17,), - array(17,), - array(9,), - array(17,), - array(34,), - array(44,), - array(17,), - array(50,), - array(14,), array(37,), + array(19,), + array(2,), + array(1,), + array(1,), + array(2,), + array(1,), + array(1,), + array(), + array(), + array(), + array(), + array(), + array(), + array(1, 2, 3, 37, 39, 40, 48, 55, 56, 57, 58,), + array(15, 23, 25, 28, 34, 36, 38, 45,), + array(15, 17, 28, 34, 37, 48,), + array(15, 24, 28, 34, 46,), + array(15, 24, 28, 34, 46,), + array(11, 14, 18, 50,), + array(37, 45, 48, 53,), + array(24, 46, 60,), + array(24, 46, 53,), + array(30, 37, 48,), + array(8, 10,), + array(36, 38,), + array(23, 36,), + array(45, 53,), + array(36, 38,), + array(36, 38,), + array(24, 46,), + array(17, 45,), + array(37, 48,), + array(37, 48,), + array(37, 48,), + array(18, 50,), + array(9, 10,), + array(36, 53,), + array(51,), + array(18,), + array(18,), + array(18,), + array(18,), + array(18,), + array(18,), + array(45,), + array(35,), + array(35,), + array(18,), + array(17,), array(15,), - array(17,), - array(34,), - array(14,), - array(17,), + array(15,), + array(9,), + array(25,), array(16,), - array(24,), - array(50,), - array(52,), - array(17,), - array(36,), - array(17,), - array(40,), - array(17,), - array(52,), - array(36,), - array(17,), + array(18,), + array(38,), + array(37,), + array(51,), + array(37,), + array(53,), + array(53,), + array(18,), + array(18,), + array(41,), + array(), array(), array(), array(), @@ -865,42 +1013,76 @@ class Smarty_Internal_Templateparser array(), ); static public $yy_default = array( - 333, 507, 507, 492, 507, 471, 471, 471, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 373, 352, 373, 507, 507, 507, - 507, 507, 507, 507, 507, 378, 345, 507, 507, 375, - 384, 380, 469, 470, 345, 378, 493, 395, 495, 494, - 385, 357, 400, 399, 507, 507, 411, 507, 373, 507, - 507, 373, 373, 507, 426, 507, 373, 483, 373, 364, - 322, 425, 507, 387, 387, 436, 387, 436, 426, 436, - 426, 367, 387, 373, 507, 507, 387, 373, 354, 507, - 373, 404, 394, 426, 387, 403, 480, 369, 398, 390, - 402, 391, 331, 478, 425, 425, 425, 425, 425, 507, - 438, 436, 452, 346, 349, 350, 348, 434, 433, 507, - 353, 464, 462, 356, 436, 507, 507, 362, 461, 342, - 430, 429, 363, 463, 361, 355, 359, 360, 431, 432, - 484, 458, 481, 370, 368, 473, 420, 393, 472, 436, - 365, 477, 477, 331, 436, 477, 436, 411, 407, 411, - 401, 401, 437, 411, 411, 401, 401, 507, 407, 411, - 507, 507, 507, 421, 407, 401, 507, 507, 507, 329, - 507, 507, 507, 507, 507, 409, 407, 507, 507, 507, - 507, 507, 507, 507, 507, 507, 507, 381, 507, 507, - 507, 482, 507, 413, 507, 416, 452, 507, 386, 443, - 451, 445, 444, 466, 413, 457, 358, 452, 448, 382, - 446, 374, 442, 479, 467, 392, 475, 405, 414, 474, - 366, 455, 456, 476, 415, 423, 388, 389, 406, 441, - 440, 424, 435, 439, 454, 372, 328, 330, 332, 327, - 326, 323, 324, 325, 334, 335, 341, 371, 351, 339, - 338, 336, 337, 408, 410, 496, 497, 498, 504, 503, - 468, 340, 459, 501, 500, 489, 491, 490, 499, 506, - 502, 505, 453, 460, 397, 419, 422, 396, 418, 412, - 416, 417, 449, 447, 488, 427, 428, 487, 486, 450, - 485, 465, + 334, 509, 509, 494, 509, 509, 509, 473, 509, 473, + 473, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 375, 375, 354, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 347, 380, 509, 497, + 386, 495, 496, 471, 347, 359, 380, 472, 377, 397, + 382, 387, 401, 402, 509, 509, 413, 509, 375, 509, + 509, 375, 375, 375, 428, 375, 509, 509, 485, 366, + 323, 427, 389, 438, 509, 389, 389, 438, 428, 438, + 428, 509, 375, 375, 375, 389, 389, 509, 356, 509, + 369, 482, 400, 406, 371, 428, 396, 405, 389, 392, + 480, 332, 404, 393, 427, 427, 427, 427, 427, 509, + 440, 454, 438, 348, 364, 344, 436, 463, 365, 438, + 352, 355, 361, 357, 464, 509, 433, 362, 358, 509, + 431, 434, 435, 466, 509, 363, 350, 351, 465, 432, + 486, 460, 367, 438, 483, 475, 372, 395, 474, 370, + 422, 438, 479, 438, 479, 479, 332, 413, 409, 413, + 403, 403, 439, 413, 403, 403, 413, 330, 509, 509, + 409, 509, 509, 403, 409, 423, 413, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 409, 509, + 411, 509, 509, 509, 509, 509, 383, 509, 509, 509, + 484, 509, 454, 418, 509, 509, 509, 415, 376, 388, + 447, 481, 446, 454, 445, 448, 453, 360, 468, 469, + 384, 459, 444, 450, 415, 490, 476, 477, 407, 368, + 478, 456, 457, 458, 416, 417, 443, 390, 391, 442, + 441, 425, 426, 437, 374, 353, 329, 331, 333, 328, + 327, 324, 325, 326, 335, 336, 341, 343, 373, 340, + 339, 337, 338, 408, 410, 506, 498, 499, 505, 461, + 455, 470, 342, 500, 503, 491, 493, 492, 501, 508, + 502, 504, 507, 462, 430, 398, 399, 421, 420, 419, + 412, 414, 418, 424, 451, 489, 394, 429, 488, 487, + 449, 452, 467, ); - public static $yyFallback = array(); - public static $yyRuleName = array( + public static $yyFallback = array(); + public $yyTraceFILE; + public $yyTracePrompt; +public $yyidx; +public $yyerrcnt; +public $yystack = array(); + public $yyTokenName = array( + '$', 'VERT', 'COLON', 'UNIMATH', + 'PHP', 'TEXT', 'STRIPON', 'STRIPOFF', + 'LITERALSTART', 'LITERALEND', 'LITERAL', 'SIMPELOUTPUT', + 'SIMPLETAG', 'SMARTYBLOCKCHILDPARENT', 'LDEL', 'RDEL', + 'DOLLARID', 'EQUAL', 'ID', 'PTR', + 'LDELMAKENOCACHE', 'LDELIF', 'LDELFOR', 'SEMICOLON', + 'INCDEC', 'TO', 'STEP', 'LDELFOREACH', + 'SPACE', 'AS', 'APTR', 'LDELSETFILTER', + 'CLOSETAG', 'LDELSLASH', 'ATTR', 'INTEGER', + 'COMMA', 'OPENP', 'CLOSEP', 'MATH', + 'ISIN', 'QMARK', 'NOT', 'TYPECAST', + 'HEX', 'DOT', 'INSTANCEOF', 'SINGLEQUOTESTRING', + 'DOUBLECOLON', 'NAMESPACE', 'AT', 'HATCH', + 'OPENB', 'CLOSEB', 'DOLLAR', 'LOGOP', + 'SLOGOP', 'TLOGOP', 'SINGLECOND', 'QUOTE', + 'BACKTICK', 'error', 'start', 'template', + 'literal_e2', 'literal_e1', 'smartytag', 'tagbody', + 'tag', 'outattr', 'eqoutattr', 'varindexed', + 'output', 'attributes', 'variable', 'value', + 'expr', 'modifierlist', 'statement', 'statements', + 'foraction', 'varvar', 'modparameters', 'attribute', + 'ternary', 'array', 'tlop', 'lop', + 'scond', 'function', 'ns1', 'doublequoted_with_quotes', + 'static_class_access', 'object', 'arrayindex', 'indexdef', + 'varvarele', 'objectchain', 'objectelement', 'method', + 'params', 'modifier', 'modparameter', 'arrayelements', + 'arrayelement', 'doublequoted', 'doublequotedcontent', + ); + public static $yyRuleName = array( 'start ::= template', 'template ::= template PHP', 'template ::= template TEXT', @@ -915,6 +1097,7 @@ class Smarty_Internal_Templateparser 'template ::=', 'smartytag ::= SIMPELOUTPUT', 'smartytag ::= SIMPLETAG', + 'smartytag ::= SMARTYBLOCKCHILDPARENT', 'smartytag ::= LDEL tagbody RDEL', 'smartytag ::= tag RDEL', 'tagbody ::= outattr', @@ -1087,194 +1270,195 @@ class Smarty_Internal_Templateparser 'doublequotedcontent ::= smartytag', 'doublequotedcontent ::= TEXT', ); - public static $yyRuleInfo = array( - array(0 => 61, 1 => 1), - array(0 => 62, 1 => 2), - array(0 => 62, 1 => 2), - array(0 => 62, 1 => 2), - array(0 => 62, 1 => 2), - array(0 => 62, 1 => 4), + public static $yyRuleInfo = array( + array(0 => 62, 1 => 1), + array(0 => 63, 1 => 2), + array(0 => 63, 1 => 2), + array(0 => 63, 1 => 2), + array(0 => 63, 1 => 2), array(0 => 63, 1 => 4), - array(0 => 63, 1 => 1), - array(0 => 64, 1 => 2), - array(0 => 64, 1 => 0), - array(0 => 62, 1 => 2), - array(0 => 62, 1 => 0), - array(0 => 65, 1 => 1), - array(0 => 65, 1 => 1), - array(0 => 65, 1 => 3), + array(0 => 64, 1 => 4), + array(0 => 64, 1 => 1), array(0 => 65, 1 => 2), + array(0 => 65, 1 => 0), + array(0 => 63, 1 => 2), + array(0 => 63, 1 => 0), array(0 => 66, 1 => 1), + array(0 => 66, 1 => 1), + array(0 => 66, 1 => 1), + array(0 => 66, 1 => 3), array(0 => 66, 1 => 2), - array(0 => 66, 1 => 2), + array(0 => 67, 1 => 1), + array(0 => 67, 1 => 2), + array(0 => 67, 1 => 2), + array(0 => 70, 1 => 2), array(0 => 69, 1 => 2), - array(0 => 68, 1 => 2), - array(0 => 71, 1 => 1), - array(0 => 71, 1 => 1), - array(0 => 71, 1 => 1), - array(0 => 67, 1 => 3), - array(0 => 67, 1 => 2), - array(0 => 67, 1 => 4), - array(0 => 67, 1 => 5), - array(0 => 67, 1 => 6), - array(0 => 67, 1 => 2), - array(0 => 67, 1 => 2), - array(0 => 67, 1 => 3), - array(0 => 67, 1 => 2), - array(0 => 67, 1 => 3), - array(0 => 67, 1 => 8), - array(0 => 79, 1 => 2), - array(0 => 79, 1 => 1), - array(0 => 67, 1 => 5), - array(0 => 67, 1 => 7), - array(0 => 67, 1 => 6), - array(0 => 67, 1 => 8), - array(0 => 67, 1 => 2), - array(0 => 67, 1 => 3), - array(0 => 67, 1 => 4), - array(0 => 65, 1 => 1), - array(0 => 67, 1 => 2), - array(0 => 67, 1 => 3), - array(0 => 67, 1 => 4), - array(0 => 67, 1 => 5), - array(0 => 72, 1 => 2), array(0 => 72, 1 => 1), - array(0 => 72, 1 => 0), - array(0 => 82, 1 => 4), - array(0 => 82, 1 => 2), - array(0 => 82, 1 => 2), - array(0 => 82, 1 => 2), - array(0 => 82, 1 => 2), - array(0 => 82, 1 => 2), - array(0 => 82, 1 => 4), - array(0 => 78, 1 => 1), - array(0 => 78, 1 => 3), - array(0 => 77, 1 => 3), - array(0 => 77, 1 => 3), - array(0 => 77, 1 => 3), - array(0 => 77, 1 => 3), - array(0 => 75, 1 => 1), - array(0 => 75, 1 => 1), - array(0 => 75, 1 => 3), - array(0 => 75, 1 => 3), - array(0 => 75, 1 => 3), - array(0 => 75, 1 => 1), - array(0 => 75, 1 => 2), - array(0 => 75, 1 => 3), - array(0 => 75, 1 => 3), - array(0 => 75, 1 => 2), - array(0 => 75, 1 => 3), - array(0 => 75, 1 => 3), - array(0 => 83, 1 => 7), - array(0 => 83, 1 => 7), - array(0 => 74, 1 => 1), - array(0 => 74, 1 => 2), - array(0 => 74, 1 => 2), - array(0 => 74, 1 => 2), - array(0 => 74, 1 => 2), - array(0 => 74, 1 => 1), - array(0 => 74, 1 => 1), - array(0 => 74, 1 => 3), - array(0 => 74, 1 => 2), - array(0 => 74, 1 => 2), - array(0 => 74, 1 => 1), - array(0 => 74, 1 => 1), - array(0 => 74, 1 => 3), - array(0 => 74, 1 => 3), - array(0 => 74, 1 => 3), - array(0 => 74, 1 => 1), - array(0 => 74, 1 => 1), - array(0 => 74, 1 => 3), - array(0 => 74, 1 => 1), - array(0 => 74, 1 => 2), - array(0 => 74, 1 => 1), - array(0 => 74, 1 => 3), - array(0 => 89, 1 => 1), - array(0 => 89, 1 => 1), - array(0 => 73, 1 => 1), - array(0 => 73, 1 => 1), - array(0 => 73, 1 => 3), - array(0 => 73, 1 => 1), - array(0 => 73, 1 => 3), - array(0 => 73, 1 => 4), - array(0 => 73, 1 => 3), - array(0 => 73, 1 => 4), - array(0 => 70, 1 => 2), - array(0 => 70, 1 => 2), - array(0 => 93, 1 => 2), - array(0 => 93, 1 => 0), - array(0 => 94, 1 => 2), - array(0 => 94, 1 => 2), - array(0 => 94, 1 => 4), - array(0 => 94, 1 => 2), - array(0 => 94, 1 => 2), - array(0 => 94, 1 => 4), - array(0 => 94, 1 => 3), - array(0 => 94, 1 => 5), - array(0 => 94, 1 => 3), - array(0 => 94, 1 => 3), - array(0 => 94, 1 => 3), - array(0 => 94, 1 => 3), - array(0 => 94, 1 => 3), - array(0 => 94, 1 => 3), - array(0 => 94, 1 => 2), - array(0 => 80, 1 => 1), - array(0 => 80, 1 => 1), + array(0 => 72, 1 => 1), + array(0 => 72, 1 => 1), + array(0 => 68, 1 => 3), + array(0 => 68, 1 => 2), + array(0 => 68, 1 => 4), + array(0 => 68, 1 => 5), + array(0 => 68, 1 => 6), + array(0 => 68, 1 => 2), + array(0 => 68, 1 => 2), + array(0 => 68, 1 => 3), + array(0 => 68, 1 => 2), + array(0 => 68, 1 => 3), + array(0 => 68, 1 => 8), array(0 => 80, 1 => 2), - array(0 => 95, 1 => 1), - array(0 => 95, 1 => 1), - array(0 => 95, 1 => 3), - array(0 => 92, 1 => 2), - array(0 => 96, 1 => 1), - array(0 => 96, 1 => 2), - array(0 => 97, 1 => 3), - array(0 => 97, 1 => 3), - array(0 => 97, 1 => 5), - array(0 => 97, 1 => 6), - array(0 => 97, 1 => 2), - array(0 => 88, 1 => 4), - array(0 => 98, 1 => 4), - array(0 => 98, 1 => 4), - array(0 => 99, 1 => 3), - array(0 => 99, 1 => 1), - array(0 => 99, 1 => 0), + array(0 => 80, 1 => 1), + array(0 => 68, 1 => 5), + array(0 => 68, 1 => 7), + array(0 => 68, 1 => 6), + array(0 => 68, 1 => 8), + array(0 => 68, 1 => 2), + array(0 => 68, 1 => 3), + array(0 => 68, 1 => 4), + array(0 => 66, 1 => 1), + array(0 => 68, 1 => 2), + array(0 => 68, 1 => 3), + array(0 => 68, 1 => 4), + array(0 => 68, 1 => 5), + array(0 => 73, 1 => 2), + array(0 => 73, 1 => 1), + array(0 => 73, 1 => 0), + array(0 => 83, 1 => 4), + array(0 => 83, 1 => 2), + array(0 => 83, 1 => 2), + array(0 => 83, 1 => 2), + array(0 => 83, 1 => 2), + array(0 => 83, 1 => 2), + array(0 => 83, 1 => 4), + array(0 => 79, 1 => 1), + array(0 => 79, 1 => 3), + array(0 => 78, 1 => 3), + array(0 => 78, 1 => 3), + array(0 => 78, 1 => 3), + array(0 => 78, 1 => 3), + array(0 => 76, 1 => 1), + array(0 => 76, 1 => 1), + array(0 => 76, 1 => 3), + array(0 => 76, 1 => 3), + array(0 => 76, 1 => 3), + array(0 => 76, 1 => 1), + array(0 => 76, 1 => 2), + array(0 => 76, 1 => 3), array(0 => 76, 1 => 3), array(0 => 76, 1 => 2), - array(0 => 100, 1 => 3), - array(0 => 100, 1 => 2), + array(0 => 76, 1 => 3), + array(0 => 76, 1 => 3), + array(0 => 84, 1 => 7), + array(0 => 84, 1 => 7), + array(0 => 75, 1 => 1), + array(0 => 75, 1 => 2), + array(0 => 75, 1 => 2), + array(0 => 75, 1 => 2), + array(0 => 75, 1 => 2), + array(0 => 75, 1 => 1), + array(0 => 75, 1 => 1), + array(0 => 75, 1 => 3), + array(0 => 75, 1 => 2), + array(0 => 75, 1 => 2), + array(0 => 75, 1 => 1), + array(0 => 75, 1 => 1), + array(0 => 75, 1 => 3), + array(0 => 75, 1 => 3), + array(0 => 75, 1 => 3), + array(0 => 75, 1 => 1), + array(0 => 75, 1 => 1), + array(0 => 75, 1 => 3), + array(0 => 75, 1 => 1), + array(0 => 75, 1 => 2), + array(0 => 75, 1 => 1), + array(0 => 75, 1 => 3), + array(0 => 90, 1 => 1), + array(0 => 90, 1 => 1), + array(0 => 74, 1 => 1), + array(0 => 74, 1 => 1), + array(0 => 74, 1 => 3), + array(0 => 74, 1 => 1), + array(0 => 74, 1 => 3), + array(0 => 74, 1 => 4), + array(0 => 74, 1 => 3), + array(0 => 74, 1 => 4), + array(0 => 71, 1 => 2), + array(0 => 71, 1 => 2), + array(0 => 94, 1 => 2), + array(0 => 94, 1 => 0), + array(0 => 95, 1 => 2), + array(0 => 95, 1 => 2), + array(0 => 95, 1 => 4), + array(0 => 95, 1 => 2), + array(0 => 95, 1 => 2), + array(0 => 95, 1 => 4), + array(0 => 95, 1 => 3), + array(0 => 95, 1 => 5), + array(0 => 95, 1 => 3), + array(0 => 95, 1 => 3), + array(0 => 95, 1 => 3), + array(0 => 95, 1 => 3), + array(0 => 95, 1 => 3), + array(0 => 95, 1 => 3), + array(0 => 95, 1 => 2), + array(0 => 81, 1 => 1), + array(0 => 81, 1 => 1), array(0 => 81, 1 => 2), - array(0 => 81, 1 => 0), + array(0 => 96, 1 => 1), + array(0 => 96, 1 => 1), + array(0 => 96, 1 => 3), + array(0 => 93, 1 => 2), + array(0 => 97, 1 => 1), + array(0 => 97, 1 => 2), + array(0 => 98, 1 => 3), + array(0 => 98, 1 => 3), + array(0 => 98, 1 => 5), + array(0 => 98, 1 => 6), + array(0 => 98, 1 => 2), + array(0 => 89, 1 => 4), + array(0 => 99, 1 => 4), + array(0 => 99, 1 => 4), + array(0 => 100, 1 => 3), + array(0 => 100, 1 => 1), + array(0 => 100, 1 => 0), + array(0 => 77, 1 => 3), + array(0 => 77, 1 => 2), + array(0 => 101, 1 => 3), array(0 => 101, 1 => 2), - array(0 => 101, 1 => 2), - array(0 => 91, 1 => 1), - array(0 => 91, 1 => 2), - array(0 => 91, 1 => 1), + array(0 => 82, 1 => 2), + array(0 => 82, 1 => 0), + array(0 => 102, 1 => 2), + array(0 => 102, 1 => 2), + array(0 => 92, 1 => 1), + array(0 => 92, 1 => 2), + array(0 => 92, 1 => 1), + array(0 => 92, 1 => 2), + array(0 => 92, 1 => 3), + array(0 => 87, 1 => 1), + array(0 => 87, 1 => 1), + array(0 => 86, 1 => 1), + array(0 => 88, 1 => 1), + array(0 => 85, 1 => 3), + array(0 => 103, 1 => 1), + array(0 => 103, 1 => 3), + array(0 => 103, 1 => 0), + array(0 => 104, 1 => 3), + array(0 => 104, 1 => 3), + array(0 => 104, 1 => 1), array(0 => 91, 1 => 2), array(0 => 91, 1 => 3), - array(0 => 86, 1 => 1), - array(0 => 86, 1 => 1), - array(0 => 85, 1 => 1), - array(0 => 87, 1 => 1), - array(0 => 84, 1 => 3), - array(0 => 102, 1 => 1), - array(0 => 102, 1 => 3), - array(0 => 102, 1 => 0), - array(0 => 103, 1 => 3), - array(0 => 103, 1 => 3), - array(0 => 103, 1 => 1), - array(0 => 90, 1 => 2), - array(0 => 90, 1 => 3), - array(0 => 104, 1 => 2), - array(0 => 104, 1 => 1), - array(0 => 105, 1 => 3), - array(0 => 105, 1 => 3), - array(0 => 105, 1 => 1), - array(0 => 105, 1 => 3), - array(0 => 105, 1 => 3), - array(0 => 105, 1 => 1), + array(0 => 105, 1 => 2), array(0 => 105, 1 => 1), + array(0 => 106, 1 => 3), + array(0 => 106, 1 => 3), + array(0 => 106, 1 => 1), + array(0 => 106, 1 => 3), + array(0 => 106, 1 => 3), + array(0 => 106, 1 => 1), + array(0 => 106, 1 => 1), ); - public static $yyReduceMap = array( + public static $yyReduceMap = array( 0 => 0, 1 => 1, 2 => 2, @@ -1283,26 +1467,26 @@ class Smarty_Internal_Templateparser 5 => 5, 6 => 6, 7 => 7, - 21 => 7, 22 => 7, 23 => 7, - 36 => 7, - 56 => 7, + 24 => 7, + 37 => 7, 57 => 7, - 65 => 7, + 58 => 7, 66 => 7, - 70 => 7, - 79 => 7, - 84 => 7, + 67 => 7, + 71 => 7, + 80 => 7, 85 => 7, - 90 => 7, - 94 => 7, + 86 => 7, + 91 => 7, 95 => 7, - 99 => 7, - 101 => 7, - 106 => 7, - 168 => 7, - 173 => 7, + 96 => 7, + 100 => 7, + 102 => 7, + 107 => 7, + 169 => 7, + 174 => 7, 8 => 8, 9 => 9, 10 => 10, @@ -1315,7 +1499,7 @@ class Smarty_Internal_Templateparser 18 => 18, 19 => 19, 20 => 20, - 24 => 24, + 21 => 21, 25 => 25, 26 => 26, 27 => 27, @@ -1323,11 +1507,11 @@ class Smarty_Internal_Templateparser 29 => 29, 30 => 30, 31 => 31, - 33 => 31, 32 => 32, - 34 => 34, + 34 => 32, + 33 => 33, 35 => 35, - 37 => 37, + 36 => 36, 38 => 38, 39 => 39, 40 => 40, @@ -1341,84 +1525,84 @@ class Smarty_Internal_Templateparser 48 => 48, 49 => 49, 50 => 50, - 59 => 50, - 148 => 50, - 152 => 50, - 156 => 50, - 157 => 50, 51 => 51, + 60 => 51, 149 => 51, - 155 => 51, + 153 => 51, + 157 => 51, + 158 => 51, 52 => 52, + 150 => 52, + 156 => 52, 53 => 53, - 54 => 53, - 55 => 55, - 133 => 55, - 58 => 58, - 60 => 60, + 54 => 54, + 55 => 54, + 56 => 56, + 134 => 56, + 59 => 59, 61 => 61, - 62 => 61, - 63 => 63, + 62 => 62, + 63 => 62, 64 => 64, - 67 => 67, + 65 => 65, 68 => 68, - 69 => 68, - 71 => 71, - 98 => 71, + 69 => 69, + 70 => 69, 72 => 72, + 99 => 72, 73 => 73, 74 => 74, 75 => 75, 76 => 76, 77 => 77, 78 => 78, - 80 => 80, - 82 => 80, - 83 => 80, - 113 => 80, + 79 => 79, 81 => 81, - 86 => 86, + 83 => 81, + 84 => 81, + 114 => 81, + 82 => 82, 87 => 87, 88 => 88, 89 => 89, - 91 => 91, + 90 => 90, 92 => 92, - 93 => 92, - 96 => 96, + 93 => 93, + 94 => 93, 97 => 97, - 100 => 100, - 102 => 102, + 98 => 98, + 101 => 101, 103 => 103, 104 => 104, 105 => 105, - 107 => 107, + 106 => 106, 108 => 108, 109 => 109, 110 => 110, 111 => 111, 112 => 112, - 114 => 114, - 170 => 114, + 113 => 113, 115 => 115, + 171 => 115, 116 => 116, 117 => 117, 118 => 118, 119 => 119, 120 => 120, - 128 => 120, 121 => 121, + 129 => 121, 122 => 122, 123 => 123, - 124 => 123, - 126 => 123, - 127 => 123, - 125 => 125, - 129 => 129, + 124 => 124, + 125 => 124, + 127 => 124, + 128 => 124, + 126 => 126, 130 => 130, 131 => 131, - 174 => 131, 132 => 132, - 134 => 134, + 175 => 132, + 133 => 133, 135 => 135, 136 => 136, 137 => 137, @@ -1432,11 +1616,11 @@ class Smarty_Internal_Templateparser 145 => 145, 146 => 146, 147 => 147, - 150 => 150, + 148 => 148, 151 => 151, - 153 => 153, + 152 => 152, 154 => 154, - 158 => 158, + 155 => 155, 159 => 159, 160 => 160, 161 => 161, @@ -1446,155 +1630,23 @@ class Smarty_Internal_Templateparser 165 => 165, 166 => 166, 167 => 167, - 169 => 169, - 171 => 171, + 168 => 168, + 170 => 170, 172 => 172, - 175 => 175, + 173 => 173, 176 => 176, 177 => 177, 178 => 178, - 181 => 178, 179 => 179, 182 => 179, 180 => 180, - 183 => 183, + 183 => 180, + 181 => 181, 184 => 184, - ); - /** - * result status - * - * @var bool - */ - public $successful = true; - /** - * return value - * - * @var mixed - */ - public $retvalue = 0; - /** - * @var - */ - public $yymajor; - /** - * last index of array variable - * - * @var mixed - */ - public $last_index; - /** - * last variable name - * - * @var string - */ - public $last_variable; - /** - * root parse tree buffer - * - * @var Smarty_Internal_ParseTree - */ - public $root_buffer; - /** - * current parse tree object - * - * @var Smarty_Internal_ParseTree - */ - public $current_buffer; - /** - * lexer object - * - * @var Smarty_Internal_Templatelexer - */ - public $lex; - /** - * {strip} status - * - * @var bool - */ - public $strip = false; - /** - * compiler object - * - * @var Smarty_Internal_TemplateCompilerBase - */ - public $compiler = null; - /** - * smarty object - * - * @var Smarty - */ - public $smarty = null; - /** - * template object - * - * @var Smarty_Internal_Template - */ - public $template = null; - /** - * block nesting level - * - * @var int - */ - public $block_nesting_level = 0; - /** - * security object - * - * @var Smarty_Security - */ - public $security = null; - /** - * template prefix array - * - * @var \Smarty_Internal_ParseTree[] - */ - public $template_prefix = array(); - /** - * template prefix array - * - * @var \Smarty_Internal_ParseTree[] - */ - public $template_postfix = array(); - public $yyTraceFILE; - public $yyTracePrompt; - public $yyidx; - public $yyerrcnt; - public $yystack = array(); - public $yyTokenName = array( - '$', 'VERT', 'COLON', 'UNIMATH', - 'PHP', 'TEXT', 'STRIPON', 'STRIPOFF', - 'LITERALSTART', 'LITERALEND', 'LITERAL', 'SIMPELOUTPUT', - 'SIMPLETAG', 'LDEL', 'RDEL', 'DOLLARID', - 'EQUAL', 'ID', 'PTR', 'LDELMAKENOCACHE', - 'LDELIF', 'LDELFOR', 'SEMICOLON', 'INCDEC', - 'TO', 'STEP', 'LDELFOREACH', 'SPACE', - 'AS', 'APTR', 'LDELSETFILTER', 'CLOSETAG', - 'LDELSLASH', 'ATTR', 'INTEGER', 'COMMA', - 'OPENP', 'CLOSEP', 'MATH', 'ISIN', - 'QMARK', 'NOT', 'TYPECAST', 'HEX', - 'DOT', 'INSTANCEOF', 'SINGLEQUOTESTRING', 'DOUBLECOLON', - 'NAMESPACE', 'AT', 'HATCH', 'OPENB', - 'CLOSEB', 'DOLLAR', 'LOGOP', 'SLOGOP', - 'TLOGOP', 'SINGLECOND', 'QUOTE', 'BACKTICK', - 'error', 'start', 'template', 'literal_e2', - 'literal_e1', 'smartytag', 'tagbody', 'tag', - 'outattr', 'eqoutattr', 'varindexed', 'output', - 'attributes', 'variable', 'value', 'expr', - 'modifierlist', 'statement', 'statements', 'foraction', - 'varvar', 'modparameters', 'attribute', 'ternary', - 'array', 'tlop', 'lop', 'scond', - 'function', 'ns1', 'doublequoted_with_quotes', 'static_class_access', - 'object', 'arrayindex', 'indexdef', 'varvarele', - 'objectchain', 'objectelement', 'method', 'params', - 'modifier', 'modparameter', 'arrayelements', 'arrayelement', - 'doublequoted', 'doublequotedcontent', - ); - /** - * internal error flag - * - * @var bool - */ - private $internalError = false; /* Index of top element in stack */ - private $_retvalue; /* Shifts left before out of the error */ + 185 => 185, + ); /* Index of top element in stack */ + private $_retvalue; /* Shifts left before out of the error */ + /** * constructor * @@ -1610,13 +1662,6 @@ class Smarty_Internal_Templateparser $this->security = isset($this->smarty->security_policy) ? $this->smarty->security_policy : false; $this->current_buffer = $this->root_buffer = new Smarty_Internal_ParseTree_Template(); } /* The parser's stack */ - public static function yy_destructor($yymajor, $yypminor) - { - switch ($yymajor) { - default: - break; /* If no destructor action specified: do nothing */ - } - } /** * insert PHP code in current buffer @@ -1689,6 +1734,14 @@ class Smarty_Internal_Templateparser } } + public static function yy_destructor($yymajor, $yypminor) + { + switch ($yymajor) { + default: + break; /* If no destructor action specified: do nothing */ + } + } + public function yy_pop_parser_stack() { if (empty($this->yystack)) { @@ -1946,6 +1999,7 @@ class Smarty_Internal_Templateparser } #line 234 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_shift($yyNewState, $yyMajor, $yypMinor) { $this->yyidx++; @@ -1983,6 +2037,7 @@ class Smarty_Internal_Templateparser } #line 242 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r0() { $this->root_buffer->prepend_array($this, $this->template_prefix); @@ -1991,6 +2046,7 @@ class Smarty_Internal_Templateparser } #line 251 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r1() { $code = $this->compiler->compileTag('private_php', @@ -2012,6 +2068,7 @@ class Smarty_Internal_Templateparser } #line 255 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r2() { $this->current_buffer->append_subtree($this, @@ -2019,18 +2076,21 @@ class Smarty_Internal_Templateparser } #line 259 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r3() { $this->strip = true; } #line 264 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r4() { $this->strip = false; } #line 269 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r5() { $this->current_buffer->append_subtree($this, @@ -2039,30 +2099,35 @@ class Smarty_Internal_Templateparser } #line 272 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r6() { $this->_retvalue = $this->yystack[ $this->yyidx + -3 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor; } #line 276 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r7() { $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; } #line 281 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r8() { $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; } #line 285 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r9() { $this->_retvalue = ''; } #line 297 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r10() { if ($this->compiler->has_code) { @@ -2074,6 +2139,7 @@ class Smarty_Internal_Templateparser } #line 307 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r12() { $var = trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, @@ -2095,7 +2161,8 @@ class Smarty_Internal_Templateparser } } - #line 327 "../smarty/lexer/smarty_internal_templateparser.y" + #line 328 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r13() { $tag = trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, @@ -2121,20 +2188,39 @@ class Smarty_Internal_Templateparser } } - #line 331 "../smarty/lexer/smarty_internal_templateparser.y" + #line 339 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r14() { - $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; + $j = strrpos($this->yystack[ $this->yyidx + 0 ]->minor, '.'); + if ($this->yystack[ $this->yyidx + 0 ]->minor[ $j + 1 ] == 'c') { + // {$smarty.block.child} + $this->_retvalue = + $this->compiler->compileTag('child', array(), array($this->yystack[ $this->yyidx + 0 ]->minor));; + } else { + // {$smarty.block.parent} + $this->_retvalue = + $this->compiler->compileTag('parent', array(), array($this->yystack[ $this->yyidx + 0 ]->minor));; + } } - #line 335 "../smarty/lexer/smarty_internal_templateparser.y" + #line 343 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r15() { $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; } - #line 344 "../smarty/lexer/smarty_internal_templateparser.y" + #line 347 "../smarty/lexer/smarty_internal_templateparser.y" + function yy_r16() + { + $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; + } + + #line 356 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r17() { $this->_retvalue = $this->compiler->compileTag('private_print_expression', $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ], @@ -2142,8 +2228,9 @@ class Smarty_Internal_Templateparser 0 ]->minor[ 0 ])); } - #line 348 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r17() + #line 360 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r18() { $this->_retvalue = $this->compiler->compileTag('assign', array_merge(array(array('value' => $this->yystack[ $this->yyidx + @@ -2155,8 +2242,9 @@ class Smarty_Internal_Templateparser $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ])); } - #line 352 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r18() + #line 364 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r19() { $this->_retvalue = $this->compiler->compileTag('assign', array_merge(array(array('value' => $this->yystack[ $this->yyidx + @@ -2168,20 +2256,23 @@ class Smarty_Internal_Templateparser -1 ]->minor[ 'smarty_internal_index' ])); } - #line 356 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r19() + #line 368 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r20() { $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 371 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r20() + #line 383 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r21() { $this->_retvalue = array($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor); } - #line 381 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r24() + #line 393 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r25() { if (defined($this->yystack[ $this->yyidx + -1 ]->minor)) { if ($this->security) { @@ -2197,8 +2288,9 @@ class Smarty_Internal_Templateparser } } - #line 394 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r25() + #line 406 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r26() { if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) { if ($this->security) { @@ -2212,8 +2304,9 @@ class Smarty_Internal_Templateparser } } - #line 406 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r26() + #line 418 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r27() { if (defined($this->yystack[ $this->yyidx + -2 ]->minor)) { if ($this->security) { @@ -2233,8 +2326,9 @@ class Smarty_Internal_Templateparser } } - #line 411 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r27() + #line 423 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r28() { $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -3 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, @@ -2242,8 +2336,9 @@ class Smarty_Internal_Templateparser -1 ]->minor)); } - #line 416 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r28() + #line 428 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r29() { $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -4 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, @@ -2253,8 +2348,9 @@ class Smarty_Internal_Templateparser -2 ]->minor)); } - #line 421 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r29() + #line 433 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r30() { $this->_retvalue = $this->compiler->compileTag('make_nocache', array(array('var' => '\'' . substr($this->yystack[ $this->yyidx + @@ -2262,8 +2358,9 @@ class Smarty_Internal_Templateparser 1) . '\''))); } - #line 426 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r30() + #line 438 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r31() { $tag = trim(substr($this->yystack[ $this->yyidx + -1 ]->minor, $this->compiler->getLdelLength())); $this->_retvalue = $this->compiler->compileTag(($tag === 'else if') ? 'elseif' : $tag, @@ -2272,8 +2369,9 @@ class Smarty_Internal_Templateparser 0 ]->minor)); } - #line 431 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r31() + #line 443 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r32() { $tag = trim(substr($this->yystack[ $this->yyidx + -2 ]->minor, $this->compiler->getLdelLength())); $this->_retvalue = $this->compiler->compileTag(($tag === 'else if') ? 'elseif' : $tag, @@ -2282,8 +2380,9 @@ class Smarty_Internal_Templateparser -1 ]->minor)); } - #line 442 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r32() + #line 454 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r33() { $tag = trim(substr($this->yystack[ $this->yyidx + -1 ]->minor, $this->compiler->getLdelLength())); $this->_retvalue = $this->compiler->compileTag(($tag === 'else if') ? 'elseif' : $tag, @@ -2292,8 +2391,9 @@ class Smarty_Internal_Templateparser 0 ]->minor)); } - #line 446 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r34() + #line 458 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r35() { $this->_retvalue = $this->compiler->compileTag('for', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, @@ -2308,14 +2408,16 @@ class Smarty_Internal_Templateparser 1); } - #line 454 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r35() + #line 466 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r36() { $this->_retvalue = '=' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 458 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r37() + #line 470 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r38() { $this->_retvalue = $this->compiler->compileTag('for', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, @@ -2326,8 +2428,9 @@ class Smarty_Internal_Templateparser 0); } - #line 463 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r38() + #line 475 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r39() { $this->_retvalue = $this->compiler->compileTag('for', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, @@ -2340,8 +2443,9 @@ class Smarty_Internal_Templateparser 0); } - #line 467 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r39() + #line 479 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r40() { $this->_retvalue = $this->compiler->compileTag('foreach', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, @@ -2351,8 +2455,9 @@ class Smarty_Internal_Templateparser -1 ]->minor)))); } - #line 470 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r40() + #line 482 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r41() { $this->_retvalue = $this->compiler->compileTag('foreach', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, @@ -2364,14 +2469,16 @@ class Smarty_Internal_Templateparser -3 ]->minor)))); } - #line 475 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r41() + #line 487 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r42() { $this->_retvalue = $this->compiler->compileTag('foreach', $this->yystack[ $this->yyidx + 0 ]->minor); } - #line 479 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r42() + #line 491 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r43() { $this->_retvalue = $this->compiler->compileTag('setfilter', array(), @@ -2381,8 +2488,9 @@ class Smarty_Internal_Templateparser 0 ]->minor)))); } - #line 485 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r43() + #line 497 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r44() { $this->_retvalue = $this->compiler->compileTag('setfilter', array(), @@ -2394,8 +2502,9 @@ class Smarty_Internal_Templateparser 0 ]->minor))); } - #line 494 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r44() + #line 506 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r45() { $tag = trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler->getLdelLength(), @@ -2409,14 +2518,16 @@ class Smarty_Internal_Templateparser } } - #line 498 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r45() + #line 510 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r46() { $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + 0 ]->minor . 'close', array()); } - #line 503 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r46() + #line 515 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r47() { $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -1 ]->minor . 'close', array(), @@ -2424,8 +2535,9 @@ class Smarty_Internal_Templateparser 0 ]->minor)); } - #line 507 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r47() + #line 519 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r48() { $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -2 ]->minor . 'close', array(), @@ -2433,8 +2545,9 @@ class Smarty_Internal_Templateparser 0 ]->minor)); } - #line 515 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r48() + #line 527 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r49() { $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -3 ]->minor . 'close', array(), @@ -2444,27 +2557,31 @@ class Smarty_Internal_Templateparser 0 ]->minor)); } - #line 521 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r49() + #line 533 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r50() { $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; $this->_retvalue[] = $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 526 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r50() + #line 538 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r51() { $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor); } - #line 531 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r51() + #line 543 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r52() { $this->_retvalue = array(); } - #line 542 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r52() + #line 554 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r53() { if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) { if ($this->security) { @@ -2479,72 +2596,82 @@ class Smarty_Internal_Templateparser } } - #line 550 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r53() + #line 562 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r54() { $this->_retvalue = array(trim($this->yystack[ $this->yyidx + -1 ]->minor, " =\n\r\t") => $this->yystack[ $this->yyidx + 0 ]->minor); } - #line 562 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r55() + #line 574 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r56() { $this->_retvalue = '\'' . $this->yystack[ $this->yyidx + 0 ]->minor . '\''; } - #line 575 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r58() + #line 587 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r59() { $this->_retvalue = array($this->yystack[ $this->yyidx + -2 ]->minor => $this->yystack[ $this->yyidx + 0 ]->minor); } - #line 580 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r60() + #line 592 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r61() { $this->yystack[ $this->yyidx + -2 ]->minor[] = $this->yystack[ $this->yyidx + 0 ]->minor; $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor; } - #line 587 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r61() + #line 599 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r62() { $this->_retvalue = array('var' => '\'' . substr($this->yystack[ $this->yyidx + -2 ]->minor, 1) . '\'', 'value' => $this->yystack[ $this->yyidx + 0 ]->minor); } - #line 591 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r63() + #line 603 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r64() { $this->_retvalue = array('var' => $this->yystack[ $this->yyidx + -2 ]->minor, 'value' => $this->yystack[ $this->yyidx + 0 ]->minor); } - #line 611 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r64() + #line 623 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r65() { $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; } - #line 616 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r67() + #line 628 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r68() { $this->_retvalue = '$_smarty_tpl->getStreamVariable(\'' . substr($this->yystack[ $this->yyidx + -2 ]->minor, 1) . '://' . $this->yystack[ $this->yyidx + 0 ]->minor . '\')'; } - #line 630 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r68() + #line 642 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r69() { $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . trim($this->yystack[ $this->yyidx + -1 ]->minor) . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 636 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r71() + #line 648 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r72() { $this->_retvalue = $this->compiler->compileTag('private_modifier', array(), @@ -2554,44 +2681,50 @@ class Smarty_Internal_Templateparser 0 ]->minor)); } - #line 640 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r72() + #line 652 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r73() { $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor[ 'pre' ] . $this->yystack[ $this->yyidx + -2 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor[ 'op' ] . $this->yystack[ $this->yyidx + 0 ]->minor . ')'; } - #line 644 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r73() + #line 656 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r74() { $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 648 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r74() + #line 660 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r75() { $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor . ')'; } - #line 652 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r75() + #line 664 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r76() { $this->_retvalue = 'in_array(' . $this->yystack[ $this->yyidx + -2 ]->minor . ',' . $this->yystack[ $this->yyidx + 0 ]->minor . ')'; } - #line 660 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r76() + #line 672 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r77() { $this->_retvalue = 'in_array(' . $this->yystack[ $this->yyidx + -2 ]->minor . ',(array)' . $this->yystack[ $this->yyidx + 0 ]->minor . ')'; } - #line 664 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r77() + #line 676 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r78() { $this->_retvalue = $this->yystack[ $this->yyidx + -5 ]->minor . ' ? ' . $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + @@ -2601,46 +2734,53 @@ class Smarty_Internal_Templateparser ' : ' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 674 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r78() + #line 686 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r79() { $this->_retvalue = $this->yystack[ $this->yyidx + -5 ]->minor . ' ? ' . $this->yystack[ $this->yyidx + -2 ]->minor . ' : ' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 679 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r80() + #line 691 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r81() { $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 700 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r81() + #line 712 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r82() { $this->_retvalue = '!' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 704 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r86() + #line 716 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r87() { $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . '.' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 708 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r87() + #line 720 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r88() { $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . '.'; } - #line 713 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r88() + #line 725 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r89() { $this->_retvalue = '.' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 730 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r89() + #line 742 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r90() { if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) { if ($this->security) { @@ -2652,21 +2792,24 @@ class Smarty_Internal_Templateparser } } - #line 734 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r91() + #line 746 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r92() { $this->_retvalue = '(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')'; } - #line 752 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r92() + #line 764 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r93() { $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 763 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r96() + #line 775 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r97() { $prefixVar = $this->compiler->getNewPrefixVariable(); if ($this->yystack[ $this->yyidx + -2 ]->minor[ 'var' ] === '\'smarty\'') { @@ -2687,8 +2830,9 @@ class Smarty_Internal_Templateparser $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]; } - #line 780 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r97() + #line 792 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r98() { $prefixVar = $this->compiler->getNewPrefixVariable(); $tmp = $this->compiler->appendCode('', $this->yystack[ $this->yyidx + 0 ]->minor); @@ -2696,8 +2840,9 @@ class Smarty_Internal_Templateparser $this->_retvalue = $prefixVar; } - #line 799 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r100() + #line 811 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r101() { if (!in_array(strtolower($this->yystack[ $this->yyidx + -2 ]->minor), array('self', 'parent')) && (!$this->security || $this->security->isTrustedStaticClassAccess($this->yystack[ $this->yyidx + -2 ]->minor, @@ -2718,21 +2863,24 @@ class Smarty_Internal_Templateparser } } - #line 810 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r102() + #line 822 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r103() { $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 813 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r103() + #line 825 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r104() { $this->_retvalue = $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\''); } - #line 826 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r104() + #line 838 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r105() { if ($this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ] === '\'smarty\'') { $smarty_var = $this->compiler->compileTag('private_special_variable', @@ -2749,22 +2897,25 @@ class Smarty_Internal_Templateparser } } - #line 836 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r105() + #line 848 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r106() { $this->_retvalue = '$_smarty_tpl->tpl_vars[' . $this->yystack[ $this->yyidx + -2 ]->minor . ']->' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 840 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r107() + #line 852 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r108() { $this->_retvalue = $this->compiler->compileConfigVariable('\'' . $this->yystack[ $this->yyidx + -1 ]->minor . '\''); } - #line 844 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r108() + #line 856 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r109() { $this->_retvalue = '(is_array($tmp = ' . $this->compiler->compileConfigVariable('\'' . $this->yystack[ $this->yyidx + -2 ]->minor . @@ -2772,83 +2923,93 @@ class Smarty_Internal_Templateparser $this->yystack[ $this->yyidx + 0 ]->minor . ' :null)'; } - #line 848 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r109() + #line 860 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r110() { $this->_retvalue = $this->compiler->compileConfigVariable($this->yystack[ $this->yyidx + -1 ]->minor); } - #line 852 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r110() + #line 864 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r111() { $this->_retvalue = '(is_array($tmp = ' . $this->compiler->compileConfigVariable($this->yystack[ $this->yyidx + -2 ]->minor) . ') ? $tmp' . $this->yystack[ $this->yyidx + 0 ]->minor . ' : null)'; } - #line 855 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r111() + #line 867 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r112() { - $this->_retvalue = array('var' => '\'' . - substr($this->yystack[ $this->yyidx + -1 ]->minor, 1) . - '\'', + $this->_retvalue = array('var' => '\'' . substr($this->yystack[ $this->yyidx + -1 ]->minor, 1) . '\'', 'smarty_internal_index' => $this->yystack[ $this->yyidx + 0 ]->minor); } - #line 868 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r112() + #line 880 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r113() { $this->_retvalue = array('var' => $this->yystack[ $this->yyidx + -1 ]->minor, 'smarty_internal_index' => $this->yystack[ $this->yyidx + 0 ]->minor); } - #line 874 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r114() + #line 886 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r115() { return; } - #line 877 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r115() + #line 889 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r116() { $this->_retvalue = '[' . $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\'') . ']'; } - #line 881 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r116() + #line 893 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r117() { $this->_retvalue = '[' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + 0 ]->minor) . ']'; } - #line 885 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r117() + #line 897 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r118() { $this->_retvalue = '[' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + -2 ]->minor) . '->' . $this->yystack[ $this->yyidx + 0 ]->minor . ']'; } - #line 889 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r118() + #line 901 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r119() { $this->_retvalue = '[\'' . $this->yystack[ $this->yyidx + 0 ]->minor . '\']'; } - #line 894 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r119() + #line 906 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r120() { $this->_retvalue = '[' . $this->yystack[ $this->yyidx + 0 ]->minor . ']'; } - #line 899 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r120() + #line 911 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r121() { $this->_retvalue = '[' . $this->yystack[ $this->yyidx + -1 ]->minor . ']'; } - #line 903 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r121() + #line 915 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r122() { $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable', array(), @@ -2857,8 +3018,9 @@ class Smarty_Internal_Templateparser '\'][\'index\']') . ']'; } - #line 906 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r122() + #line 918 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r123() { $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable', array(), @@ -2867,46 +3029,53 @@ class Smarty_Internal_Templateparser $this->yystack[ $this->yyidx + -1 ]->minor . '\']') . ']'; } - #line 912 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r123() + #line 924 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r124() { $this->_retvalue = '[' . $this->yystack[ $this->yyidx + -1 ]->minor . ']'; } - #line 928 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r125() + #line 940 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r126() { $this->_retvalue = '[' . $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + -1 ]->minor, 1) . '\'') . ']';; } - #line 938 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r129() + #line 950 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r130() { $this->_retvalue = '[]'; } - #line 942 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r130() + #line 954 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r131() { $this->_retvalue = '\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\''; } - #line 947 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r131() + #line 959 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r132() { $this->_retvalue = '\'\''; } - #line 955 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r132() + #line 967 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r133() { $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . '.' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 961 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r134() + #line 973 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r135() { $var = trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler->getLdelLength(), @@ -2915,14 +3084,16 @@ class Smarty_Internal_Templateparser $this->_retvalue = $this->compiler->compileVariable('\'' . $var . '\''); } - #line 968 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r135() + #line 980 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r136() { $this->_retvalue = '(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')'; } - #line 977 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r136() + #line 989 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r137() { if ($this->yystack[ $this->yyidx + -1 ]->minor[ 'var' ] === '\'smarty\'') { $this->_retvalue = $this->compiler->compileTag('private_special_variable', @@ -2937,20 +3108,23 @@ class Smarty_Internal_Templateparser } } - #line 982 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r137() + #line 994 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r138() { $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 987 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r138() + #line 999 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r139() { $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 994 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r139() + #line 1006 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r140() { if ($this->security && substr($this->yystack[ $this->yyidx + -1 ]->minor, 0, 1) === '_') { $this->compiler->trigger_template_error(self::Err1); @@ -2959,8 +3133,9 @@ class Smarty_Internal_Templateparser '->' . $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 1001 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r140() + #line 1013 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r141() { if ($this->security) { $this->compiler->trigger_template_error(self::Err2); @@ -2969,8 +3144,9 @@ class Smarty_Internal_Templateparser $this->yystack[ $this->yyidx + 0 ]->minor . '}'; } - #line 1008 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r141() + #line 1020 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r142() { if ($this->security) { $this->compiler->trigger_template_error(self::Err2); @@ -2979,8 +3155,9 @@ class Smarty_Internal_Templateparser '->{' . $this->yystack[ $this->yyidx + -2 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor . '}'; } - #line 1016 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r142() + #line 1028 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r143() { if ($this->security) { $this->compiler->trigger_template_error(self::Err2); @@ -2990,21 +3167,24 @@ class Smarty_Internal_Templateparser $this->yystack[ $this->yyidx + 0 ]->minor . '}'; } - #line 1024 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r143() + #line 1036 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r144() { $this->_retvalue = '->' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 1032 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r144() + #line 1044 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r145() { $this->_retvalue = $this->compiler->compilePHPFunctionCall($this->yystack[ $this->yyidx + -3 ]->minor, $this->yystack[ $this->yyidx + -1 ]->minor); } - #line 1039 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r145() + #line 1051 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r146() { if ($this->security && substr($this->yystack[ $this->yyidx + -3 ]->minor, 0, 1) === '_') { $this->compiler->trigger_template_error(self::Err1); @@ -3013,8 +3193,9 @@ class Smarty_Internal_Templateparser implode(',', $this->yystack[ $this->yyidx + -1 ]->minor) . ')'; } - #line 1050 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r146() + #line 1062 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r147() { if ($this->security) { $this->compiler->trigger_template_error(self::Err2); @@ -3028,83 +3209,95 @@ class Smarty_Internal_Templateparser $this->_retvalue = $prefixVar . '(' . implode(',', $this->yystack[ $this->yyidx + -1 ]->minor) . ')'; } - #line 1067 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r147() + #line 1079 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r148() { $this->_retvalue = array_merge($this->yystack[ $this->yyidx + -2 ]->minor, array($this->yystack[ $this->yyidx + 0 ]->minor)); } - #line 1071 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r150() + #line 1083 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r151() { $this->_retvalue = array_merge($this->yystack[ $this->yyidx + -2 ]->minor, array(array_merge($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor))); } - #line 1079 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r151() + #line 1091 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r152() { $this->_retvalue = array(array_merge($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor)); } - #line 1087 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r153() + #line 1099 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r154() { $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor); } - #line 1106 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r154() + #line 1118 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r155() { $this->_retvalue = array_merge($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor); } - #line 1111 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r158() + #line 1123 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r159() { $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor, '', 'method'); } - #line 1116 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r159() + #line 1128 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r160() { $this->_retvalue = array($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, 'method'); } - #line 1121 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r160() + #line 1133 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r161() { $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor, ''); } - #line 1126 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r161() + #line 1138 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r162() { $this->_retvalue = array($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, 'property'); } - #line 1132 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r162() + #line 1144 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r163() { $this->_retvalue = array($this->yystack[ $this->yyidx + -2 ]->minor, $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor, 'property'); } - #line 1136 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r163() + #line 1148 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r164() { $this->_retvalue = ' ' . trim($this->yystack[ $this->yyidx + 0 ]->minor) . ' '; } - #line 1155 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r164() + #line 1167 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r165() { static $lops = array( 'eq' => ' == ', @@ -3125,8 +3318,9 @@ class Smarty_Internal_Templateparser $this->_retvalue = $lops[ $op ]; } - #line 1168 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r165() + #line 1180 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r166() { static $tlops = array( 'isdivby' => array('op' => ' % ', 'pre' => '!('), @@ -3140,8 +3334,9 @@ class Smarty_Internal_Templateparser $this->_retvalue = $tlops[ $op ]; } - #line 1182 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r166() + #line 1194 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r167() { static $scond = array( 'iseven' => '!(1 & ', @@ -3153,80 +3348,91 @@ class Smarty_Internal_Templateparser $this->_retvalue = $scond[ $op ]; } - #line 1190 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r167() + #line 1202 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r168() { $this->_retvalue = 'array(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')'; } - #line 1198 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r169() + #line 1210 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r170() { $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . ',' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 1202 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r171() + #line 1214 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r172() { $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . '=>' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 1218 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r172() + #line 1230 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r173() { $this->_retvalue = '\'' . $this->yystack[ $this->yyidx + -2 ]->minor . '\'=>' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 1224 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r175() + #line 1236 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r176() { $this->compiler->leaveDoubleQuote(); $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor->to_smarty_php($this); } - #line 1229 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r176() + #line 1241 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r177() { $this->yystack[ $this->yyidx + -1 ]->minor->append_subtree($this, $this->yystack[ $this->yyidx + 0 ]->minor); $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; } - #line 1233 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r177() + #line 1245 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r178() { $this->_retvalue = new Smarty_Internal_ParseTree_Dq($this, $this->yystack[ $this->yyidx + 0 ]->minor); } - #line 1237 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r178() + #line 1249 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r179() { $this->_retvalue = new Smarty_Internal_ParseTree_Code('(string)' . $this->yystack[ $this->yyidx + -1 ]->minor); } - #line 1241 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r179() + #line 1253 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r180() { $this->_retvalue = new Smarty_Internal_ParseTree_Code('(string)(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')'); } - #line 1253 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r180() + #line 1265 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r181() { $this->_retvalue = new Smarty_Internal_ParseTree_Code('(string)$_smarty_tpl->tpl_vars[\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\']->value'); } - #line 1257 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r183() + #line 1269 "../smarty/lexer/smarty_internal_templateparser.y" + + function yy_r184() { $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->yystack[ $this->yyidx + 0 ]->minor); } - function yy_r184() + function yy_r185() { $this->_retvalue = new Smarty_Internal_ParseTree_DqContent($this->yystack[ $this->yyidx + 0 ]->minor); } diff --git a/libs/sysplugins/smarty_internal_testinstall.php b/libs/sysplugins/smarty_internal_testinstall.php index ac353b77..bea8b3a8 100644 --- a/libs/sysplugins/smarty_internal_testinstall.php +++ b/libs/sysplugins/smarty_internal_testinstall.php @@ -200,7 +200,7 @@ class Smarty_Internal_TestInstall } else { $errors[ 'plugins_dir' ] = $message; } - } else if ($_core_plugins_dir && $_core_plugins_dir === realpath($plugin_dir)) { + } else if ($_core_plugins_dir && $_core_plugins_dir == realpath($plugin_dir)) { $_core_plugins_available = true; if ($errors === null) { echo "$plugin_dir is OK.\n"; @@ -332,157 +332,159 @@ class Smarty_Internal_TestInstall // test if sysplugins are available $source = SMARTY_SYSPLUGINS_DIR; if (is_dir($source)) { - $expectedSysplugins = array( - 'smartycompilerexception.php' => true, - 'smartyexception.php' => true, - 'smarty_cacheresource.php' => true, - 'smarty_cacheresource_custom.php' => true, - 'smarty_cacheresource_keyvaluestore.php' => true, - 'smarty_data.php' => true, - 'smarty_internal_block.php' => true, - 'smarty_internal_cacheresource_file.php' => true, - 'smarty_internal_compilebase.php' => true, - 'smarty_internal_compile_append.php' => true, - 'smarty_internal_compile_assign.php' => true, - 'smarty_internal_compile_block.php' => true, - 'smarty_internal_compile_break.php' => true, - 'smarty_internal_compile_call.php' => true, - 'smarty_internal_compile_capture.php' => true, - 'smarty_internal_compile_config_load.php' => true, - 'smarty_internal_compile_continue.php' => true, - 'smarty_internal_compile_debug.php' => true, - 'smarty_internal_compile_eval.php' => true, - 'smarty_internal_compile_extends.php' => true, - 'smarty_internal_compile_for.php' => true, - 'smarty_internal_compile_foreach.php' => true, - 'smarty_internal_compile_function.php' => true, - 'smarty_internal_compile_if.php' => true, - 'smarty_internal_compile_include.php' => true, - 'smarty_internal_compile_include_php.php' => true, - 'smarty_internal_compile_insert.php' => true, - 'smarty_internal_compile_ldelim.php' => true, - 'smarty_internal_compile_make_nocache.php' => true, - 'smarty_internal_compile_nocache.php' => true, - 'smarty_internal_compile_private_block_plugin.php' => true, - 'smarty_internal_compile_private_foreachsection.php' => true, - 'smarty_internal_compile_private_function_plugin.php' => true, - 'smarty_internal_compile_private_modifier.php' => true, - 'smarty_internal_compile_private_object_block_function.php' => true, - 'smarty_internal_compile_private_object_function.php' => true, - 'smarty_internal_compile_private_php.php' => true, - 'smarty_internal_compile_private_print_expression.php' => true, - 'smarty_internal_compile_private_registered_block.php' => true, - 'smarty_internal_compile_private_registered_function.php' => true, - 'smarty_internal_compile_private_special_variable.php' => true, - 'smarty_internal_compile_rdelim.php' => true, - 'smarty_internal_compile_section.php' => true, - 'smarty_internal_compile_setfilter.php' => true, - 'smarty_internal_compile_shared_inheritance.php' => true, - 'smarty_internal_compile_while.php' => true, - 'smarty_internal_configfilelexer.php' => true, - 'smarty_internal_configfileparser.php' => true, - 'smarty_internal_config_file_compiler.php' => true, - 'smarty_internal_data.php' => true, - 'smarty_internal_debug.php' => true, - 'smarty_internal_errorhandler.php' => true, - 'smarty_internal_extension_handler.php' => true, - 'smarty_internal_method_addautoloadfilters.php' => true, - 'smarty_internal_method_adddefaultmodifiers.php' => true, - 'smarty_internal_method_append.php' => true, - 'smarty_internal_method_appendbyref.php' => true, - 'smarty_internal_method_assignbyref.php' => true, - 'smarty_internal_method_assignglobal.php' => true, - 'smarty_internal_method_clearallassign.php' => true, - 'smarty_internal_method_clearallcache.php' => true, - 'smarty_internal_method_clearassign.php' => true, - 'smarty_internal_method_clearcache.php' => true, - 'smarty_internal_method_clearcompiledtemplate.php' => true, - 'smarty_internal_method_clearconfig.php' => true, - 'smarty_internal_method_compileallconfig.php' => true, - 'smarty_internal_method_compilealltemplates.php' => true, - 'smarty_internal_method_configload.php' => true, - 'smarty_internal_method_createdata.php' => true, - 'smarty_internal_method_getautoloadfilters.php' => true, - 'smarty_internal_method_getconfigvariable.php' => true, - 'smarty_internal_method_getconfigvars.php' => true, - 'smarty_internal_method_getdebugtemplate.php' => true, - 'smarty_internal_method_getdefaultmodifiers.php' => true, - 'smarty_internal_method_getglobal.php' => true, - 'smarty_internal_method_getregisteredobject.php' => true, - 'smarty_internal_method_getstreamvariable.php' => true, - 'smarty_internal_method_gettags.php' => true, - 'smarty_internal_method_gettemplatevars.php' => true, - 'smarty_internal_method_literals.php' => true, - 'smarty_internal_method_loadfilter.php' => true, - 'smarty_internal_method_loadplugin.php' => true, - 'smarty_internal_method_mustcompile.php' => true, - 'smarty_internal_method_registercacheresource.php' => true, - 'smarty_internal_method_registerclass.php' => true, - 'smarty_internal_method_registerdefaultconfighandler.php' => true, - 'smarty_internal_method_registerdefaultpluginhandler.php' => true, - 'smarty_internal_method_registerdefaulttemplatehandler.php' => true, - 'smarty_internal_method_registerfilter.php' => true, - 'smarty_internal_method_registerobject.php' => true, - 'smarty_internal_method_registerplugin.php' => true, - 'smarty_internal_method_registerresource.php' => true, - 'smarty_internal_method_setautoloadfilters.php' => true, - 'smarty_internal_method_setdebugtemplate.php' => true, - 'smarty_internal_method_setdefaultmodifiers.php' => true, - 'smarty_internal_method_unloadfilter.php' => true, - 'smarty_internal_method_unregistercacheresource.php' => true, - 'smarty_internal_method_unregisterfilter.php' => true, - 'smarty_internal_method_unregisterobject.php' => true, - 'smarty_internal_method_unregisterplugin.php' => true, - 'smarty_internal_method_unregisterresource.php' => true, - 'smarty_internal_nocache_insert.php' => true, - 'smarty_internal_parsetree.php' => true, - 'smarty_internal_parsetree_code.php' => true, - 'smarty_internal_parsetree_dq.php' => true, - 'smarty_internal_parsetree_dqcontent.php' => true, - 'smarty_internal_parsetree_tag.php' => true, - 'smarty_internal_parsetree_template.php' => true, - 'smarty_internal_parsetree_text.php' => true, - 'smarty_internal_resource_eval.php' => true, - 'smarty_internal_resource_extends.php' => true, - 'smarty_internal_resource_file.php' => true, - 'smarty_internal_resource_php.php' => true, - 'smarty_internal_resource_registered.php' => true, - 'smarty_internal_resource_stream.php' => true, - 'smarty_internal_resource_string.php' => true, - 'smarty_internal_runtime_cachemodify.php' => true, - 'smarty_internal_runtime_cacheresourcefile.php' => true, - 'smarty_internal_runtime_capture.php' => true, - 'smarty_internal_runtime_codeframe.php' => true, - 'smarty_internal_runtime_filterhandler.php' => true, - 'smarty_internal_runtime_foreach.php' => true, - 'smarty_internal_runtime_getincludepath.php' => true, - 'smarty_internal_runtime_inheritance.php' => true, - 'smarty_internal_runtime_make_nocache.php' => true, - 'smarty_internal_runtime_tplfunction.php' => true, - 'smarty_internal_runtime_updatecache.php' => true, - 'smarty_internal_runtime_updatescope.php' => true, - 'smarty_internal_runtime_writefile.php' => true, - 'smarty_internal_smartytemplatecompiler.php' => true, - 'smarty_internal_template.php' => true, - 'smarty_internal_templatebase.php' => true, - 'smarty_internal_templatecompilerbase.php' => true, - 'smarty_internal_templatelexer.php' => true, - 'smarty_internal_templateparser.php' => true, - 'smarty_internal_testinstall.php' => true, - 'smarty_internal_undefined.php' => true, - 'smarty_resource.php' => true, - 'smarty_resource_custom.php' => true, - 'smarty_resource_recompiled.php' => true, - 'smarty_resource_uncompiled.php' => true, - 'smarty_security.php' => true, - 'smarty_template_cached.php' => true, - 'smarty_template_compiled.php' => true, - 'smarty_template_config.php' => true, - 'smarty_template_resource_base.php' => true, - 'smarty_template_source.php' => true, - 'smarty_undefined_variable.php' => true, - 'smarty_variable.php' => true, - ); + $expectedSysplugins = array('smartycompilerexception.php' => true, + 'smartyexception.php' => true, + 'smarty_cacheresource.php' => true, + 'smarty_cacheresource_custom.php' => true, + 'smarty_cacheresource_keyvaluestore.php' => true, + 'smarty_data.php' => true, + 'smarty_internal_block.php' => true, + 'smarty_internal_cacheresource_file.php' => true, + 'smarty_internal_compilebase.php' => true, + 'smarty_internal_compile_append.php' => true, + 'smarty_internal_compile_assign.php' => true, + 'smarty_internal_compile_block.php' => true, + 'smarty_internal_compile_block_child.php' => true, + 'smarty_internal_compile_block_parent.php' => true, + 'smarty_internal_compile_child.php' => true, + 'smarty_internal_compile_parent.php' => true, + 'smarty_internal_compile_break.php' => true, + 'smarty_internal_compile_call.php' => true, + 'smarty_internal_compile_capture.php' => true, + 'smarty_internal_compile_config_load.php' => true, + 'smarty_internal_compile_continue.php' => true, + 'smarty_internal_compile_debug.php' => true, + 'smarty_internal_compile_eval.php' => true, + 'smarty_internal_compile_extends.php' => true, + 'smarty_internal_compile_for.php' => true, + 'smarty_internal_compile_foreach.php' => true, + 'smarty_internal_compile_function.php' => true, + 'smarty_internal_compile_if.php' => true, + 'smarty_internal_compile_include.php' => true, + 'smarty_internal_compile_include_php.php' => true, + 'smarty_internal_compile_insert.php' => true, + 'smarty_internal_compile_ldelim.php' => true, + 'smarty_internal_compile_make_nocache.php' => true, + 'smarty_internal_compile_nocache.php' => true, + 'smarty_internal_compile_private_block_plugin.php' => true, + 'smarty_internal_compile_private_foreachsection.php' => true, + 'smarty_internal_compile_private_function_plugin.php' => true, + 'smarty_internal_compile_private_modifier.php' => true, + 'smarty_internal_compile_private_object_block_function.php' => true, + 'smarty_internal_compile_private_object_function.php' => true, + 'smarty_internal_compile_private_php.php' => true, + 'smarty_internal_compile_private_print_expression.php' => true, + 'smarty_internal_compile_private_registered_block.php' => true, + 'smarty_internal_compile_private_registered_function.php' => true, + 'smarty_internal_compile_private_special_variable.php' => true, + 'smarty_internal_compile_rdelim.php' => true, + 'smarty_internal_compile_section.php' => true, + 'smarty_internal_compile_setfilter.php' => true, + 'smarty_internal_compile_shared_inheritance.php' => true, + 'smarty_internal_compile_while.php' => true, + 'smarty_internal_configfilelexer.php' => true, + 'smarty_internal_configfileparser.php' => true, + 'smarty_internal_config_file_compiler.php' => true, + 'smarty_internal_data.php' => true, + 'smarty_internal_debug.php' => true, + 'smarty_internal_errorhandler.php' => true, + 'smarty_internal_extension_handler.php' => true, + 'smarty_internal_method_addautoloadfilters.php' => true, + 'smarty_internal_method_adddefaultmodifiers.php' => true, + 'smarty_internal_method_append.php' => true, + 'smarty_internal_method_appendbyref.php' => true, + 'smarty_internal_method_assignbyref.php' => true, + 'smarty_internal_method_assignglobal.php' => true, + 'smarty_internal_method_clearallassign.php' => true, + 'smarty_internal_method_clearallcache.php' => true, + 'smarty_internal_method_clearassign.php' => true, + 'smarty_internal_method_clearcache.php' => true, + 'smarty_internal_method_clearcompiledtemplate.php' => true, + 'smarty_internal_method_clearconfig.php' => true, + 'smarty_internal_method_compileallconfig.php' => true, + 'smarty_internal_method_compilealltemplates.php' => true, + 'smarty_internal_method_configload.php' => true, + 'smarty_internal_method_createdata.php' => true, + 'smarty_internal_method_getautoloadfilters.php' => true, + 'smarty_internal_method_getconfigvariable.php' => true, + 'smarty_internal_method_getconfigvars.php' => true, + 'smarty_internal_method_getdebugtemplate.php' => true, + 'smarty_internal_method_getdefaultmodifiers.php' => true, + 'smarty_internal_method_getglobal.php' => true, + 'smarty_internal_method_getregisteredobject.php' => true, + 'smarty_internal_method_getstreamvariable.php' => true, + 'smarty_internal_method_gettags.php' => true, + 'smarty_internal_method_gettemplatevars.php' => true, + 'smarty_internal_method_literals.php' => true, + 'smarty_internal_method_loadfilter.php' => true, + 'smarty_internal_method_loadplugin.php' => true, + 'smarty_internal_method_mustcompile.php' => true, + 'smarty_internal_method_registercacheresource.php' => true, + 'smarty_internal_method_registerclass.php' => true, + 'smarty_internal_method_registerdefaultconfighandler.php' => true, + 'smarty_internal_method_registerdefaultpluginhandler.php' => true, + 'smarty_internal_method_registerdefaulttemplatehandler.php' => true, + 'smarty_internal_method_registerfilter.php' => true, + 'smarty_internal_method_registerobject.php' => true, + 'smarty_internal_method_registerplugin.php' => true, + 'smarty_internal_method_registerresource.php' => true, + 'smarty_internal_method_setautoloadfilters.php' => true, + 'smarty_internal_method_setdebugtemplate.php' => true, + 'smarty_internal_method_setdefaultmodifiers.php' => true, + 'smarty_internal_method_unloadfilter.php' => true, + 'smarty_internal_method_unregistercacheresource.php' => true, + 'smarty_internal_method_unregisterfilter.php' => true, + 'smarty_internal_method_unregisterobject.php' => true, + 'smarty_internal_method_unregisterplugin.php' => true, + 'smarty_internal_method_unregisterresource.php' => true, + 'smarty_internal_nocache_insert.php' => true, + 'smarty_internal_parsetree.php' => true, + 'smarty_internal_parsetree_code.php' => true, + 'smarty_internal_parsetree_dq.php' => true, + 'smarty_internal_parsetree_dqcontent.php' => true, + 'smarty_internal_parsetree_tag.php' => true, + 'smarty_internal_parsetree_template.php' => true, + 'smarty_internal_parsetree_text.php' => true, + 'smarty_internal_resource_eval.php' => true, + 'smarty_internal_resource_extends.php' => true, + 'smarty_internal_resource_file.php' => true, + 'smarty_internal_resource_php.php' => true, + 'smarty_internal_resource_registered.php' => true, + 'smarty_internal_resource_stream.php' => true, + 'smarty_internal_resource_string.php' => true, + 'smarty_internal_runtime_cachemodify.php' => true, + 'smarty_internal_runtime_cacheresourcefile.php' => true, + 'smarty_internal_runtime_capture.php' => true, + 'smarty_internal_runtime_codeframe.php' => true, + 'smarty_internal_runtime_filterhandler.php' => true, + 'smarty_internal_runtime_foreach.php' => true, + 'smarty_internal_runtime_getincludepath.php' => true, + 'smarty_internal_runtime_inheritance.php' => true, + 'smarty_internal_runtime_make_nocache.php' => true, + 'smarty_internal_runtime_tplfunction.php' => true, + 'smarty_internal_runtime_updatecache.php' => true, + 'smarty_internal_runtime_updatescope.php' => true, + 'smarty_internal_runtime_writefile.php' => true, + 'smarty_internal_smartytemplatecompiler.php' => true, + 'smarty_internal_template.php' => true, + 'smarty_internal_templatebase.php' => true, + 'smarty_internal_templatecompilerbase.php' => true, + 'smarty_internal_templatelexer.php' => true, + 'smarty_internal_templateparser.php' => true, + 'smarty_internal_testinstall.php' => true, + 'smarty_internal_undefined.php' => true, + 'smarty_resource.php' => true, + 'smarty_resource_custom.php' => true, + 'smarty_resource_recompiled.php' => true, + 'smarty_resource_uncompiled.php' => true, + 'smarty_security.php' => true, + 'smarty_template_cached.php' => true, + 'smarty_template_compiled.php' => true, + 'smarty_template_config.php' => true, + 'smarty_template_resource_base.php' => true, + 'smarty_template_source.php' => true, + 'smarty_undefined_variable.php' => true, + 'smarty_variable.php' => true,); $iterator = new DirectoryIterator($source); foreach ($iterator as $file) { if (!$file->isDot()) { From cf22e986c0ebe5b42a366df1200347ebf62cb7a7 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Wed, 28 Mar 2018 07:14:29 +0200 Subject: [PATCH 09/31] - new feature {parent} = {$smarty.block.parent} {child} = {$smarty.block.child} --- lexer/smarty_internal_templatelexer.plex | 10 +++++++--- lexer/smarty_internal_templateparser.y | 12 ++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/lexer/smarty_internal_templatelexer.plex b/lexer/smarty_internal_templatelexer.plex index 95d575ce..52ee2d7b 100644 --- a/lexer/smarty_internal_templatelexer.plex +++ b/lexer/smarty_internal_templatelexer.plex @@ -281,7 +281,7 @@ class Smarty_Internal_Templatelexer ldel = ~(SMARTYldel)SMARTYal~ rdel = ~\s*SMARTYrdel~ nocacherdel = ~(\s+nocache)?\s*SMARTYrdel~ - notblockid = ~(?:(?!block)[0-9]*[a-zA-Z_]\w*)~ + smartyblockchildparent = ~[\$]smarty\.block\.(child|parent)~ integer = ~\d+~ hex = ~0[xX][0-9a-fA-F]+~ math = ~\s*([*]{1,2}|[%/^&]|[<>]{2})\s*~ @@ -321,7 +321,6 @@ class Smarty_Internal_Templatelexer as = ~\s+as\s+~ to = ~\s+to\s+~ step = ~\s+step\s+~ - block = ~block~ if = ~(if|elseif|else if|while)\s+~ for = ~for\s+~ makenocache = ~make_nocache\s+~ @@ -406,7 +405,12 @@ class Smarty_Internal_Templatelexer $this->token = Smarty_Internal_Templateparser::TP_SIMPLETAG; $this->taglineno = $this->line; } - ldel slash notblockid rdel { + ldel smartyblockchildparent rdel { + $this->yypopstate(); + $this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILDPARENT; + $this->taglineno = $this->line; + } + ldel slash id rdel { $this->yypopstate(); $this->token = Smarty_Internal_Templateparser::TP_CLOSETAG; $this->taglineno = $this->line; diff --git a/lexer/smarty_internal_templateparser.y b/lexer/smarty_internal_templateparser.y index 45d7b194..d53cdf2d 100644 --- a/lexer/smarty_internal_templateparser.y +++ b/lexer/smarty_internal_templateparser.y @@ -324,6 +324,18 @@ smartytag(A)::= SIMPLETAG(B). { } } } + // {$smarty.block.child} or {$smarty.block.parent} +smartytag(A) ::= SMARTYBLOCKCHILDPARENT(i). { + $j = strrpos(i,'.'); + if (i[$j+1] == 'c') { + // {$smarty.block.child} + A = $this->compiler->compileTag('child',array(),array(i));; + } else { + // {$smarty.block.parent} + A = $this->compiler->compileTag('parent',array(),array(i));; + } +} + smartytag(A) ::= LDEL tagbody(B) RDEL. { A = B; } From 336c07c23fb4b55dbacabb289ea4c286652389c9 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Wed, 28 Mar 2018 07:15:29 +0200 Subject: [PATCH 10/31] - bugfix plugins may not be loaded if {function} or {block} tags are executed in nocache mode https://github.com/smarty-php/smarty/issues/371 --- change_log.txt | 4 + libs/Smarty.class.php | 2 +- .../smarty_internal_compile_block.php | 14 +- .../smarty_internal_compile_function.php | 23 ++- ...arty_internal_compile_private_modifier.php | 4 +- .../smarty_internal_runtime_codeframe.php | 32 +---- .../smarty_internal_runtime_tplfunction.php | 6 +- .../smarty_internal_runtime_updatecache.php | 16 ++- libs/sysplugins/smarty_internal_template.php | 44 ++++-- .../smarty_internal_templatecompilerbase.php | 134 ++++++++++++++---- .../smarty_template_resource_base.php | 7 - 11 files changed, 175 insertions(+), 111 deletions(-) diff --git a/change_log.txt b/change_log.txt index 3d94f2bd..f92af840 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,8 @@ ===== 3.1.32 - dev === +26.03.2018 + - bugfix plugins may not be loaded if {function} or {block} tags are executed in nocache mode + https://github.com/smarty-php/smarty/issues/371 + 26.03.2018 - new feature {parent} = {$smarty.block.parent} {child} = {$smarty.block.child} diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 97c679a0..d9e96703 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.32-dev-44'; + const SMARTY_VERSION = '3.1.32-dev-45'; /** * define variable scopes */ diff --git a/libs/sysplugins/smarty_internal_compile_block.php b/libs/sysplugins/smarty_internal_compile_block.php index fa0aa45b..88d6f37e 100644 --- a/libs/sysplugins/smarty_internal_compile_block.php +++ b/libs/sysplugins/smarty_internal_compile_block.php @@ -77,6 +77,7 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_Compile_Shared_Inher array($_attr, $compiler->nocache, $compiler->parser->current_buffer, $compiler->template->compiled->has_nocache_code, $compiler->template->caching)); + $compiler->saveRequiredPlugins(true); $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template(); $compiler->template->compiled->has_nocache_code = false; @@ -126,7 +127,8 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_Compile_Shared_ $output .= "public \${$property} = " . var_export($value,true) .";\n"; } $output .= "public function callBlock(Smarty_Internal_Template \$_smarty_tpl) {\n"; - //$output .= "/*/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/\n"; + $output .= $compiler->compileRequiredPlugins(); + $compiler->restoreRequiredPlugins(); if ($compiler->template->compiled->has_nocache_code) { $output .= "\$_smarty_tpl->cached->hashes['{$compiler->template->compiled->nocache_hash}'] = true;\n"; } @@ -151,16 +153,6 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_Compile_Shared_ $output)); $compiler->blockOrFunctionCode .= $compiler->parser->current_buffer->to_smarty_php($compiler->parser); $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template(); - // nocache plugins must be copied - if (!empty($compiler->template->compiled->required_plugins[ 'nocache' ])) { - foreach ($compiler->template->compiled->required_plugins[ 'nocache' ] as $plugin => $tmp) { - foreach ($tmp as $type => $data) { - $compiler->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin ][ $type ] = - $data; - } - } - } - // restore old status $compiler->template->compiled->has_nocache_code = $_has_nocache_code; $compiler->tag_nocache = $compiler->nocache; diff --git a/libs/sysplugins/smarty_internal_compile_function.php b/libs/sysplugins/smarty_internal_compile_function.php index 9acaafe1..909b767c 100644 --- a/libs/sysplugins/smarty_internal_compile_function.php +++ b/libs/sysplugins/smarty_internal_compile_function.php @@ -67,6 +67,7 @@ class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase // Init temporary context $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template(); $compiler->template->compiled->has_nocache_code = false; + $compiler->saveRequiredPlugins(true); return true; } } @@ -134,13 +135,14 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase $output .= "if (!function_exists('{$_funcNameCaching}')) {\n"; $output .= "function {$_funcNameCaching} (Smarty_Internal_Template \$_smarty_tpl,\$params) {\n"; $output .= "ob_start();\n"; + $output .= $compiler->compileRequiredPlugins(); $output .= "\$_smarty_tpl->compiled->has_nocache_code = true;\n"; $output .= $_paramsCode; - $output .= "foreach (\$params as \$key => \$value) {\n\$_smarty_tpl->tpl_vars[\$key] = new Smarty_Variable(\$value, \$_smarty_tpl->isRenderingCache);\n}"; + $output .= "foreach (\$params as \$key => \$value) {\n\$_smarty_tpl->tpl_vars[\$key] = new Smarty_Variable(\$value, \$_smarty_tpl->isRenderingCache);\n}\n"; $output .= "\$params = var_export(\$params, true);\n"; $output .= "echo \"/*%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/smarty->ext->_tplFunction->saveTemplateVariables(\\\$_smarty_tpl, '{$_name}');\nforeach (\$params as \\\$key => \\\$value) {\n\\\$_smarty_tpl->tpl_vars[\\\$key] = new Smarty_Variable(\\\$value, \\\$_smarty_tpl->isRenderingCache);\n}\n?>"; - $output .= "/*/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/\n\";?>"; + $output .= "/*/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/\";?>"; $compiler->parser->current_buffer->append_subtree($compiler->parser, new Smarty_Internal_ParseTree_Tag($compiler->parser, $output)); @@ -166,7 +168,9 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase $output .= "if (!function_exists('{$_funcName}')) {\n"; $output .= "function {$_funcName}(Smarty_Internal_Template \$_smarty_tpl,\$params) {\n"; $output .= $_paramsCode; - $output .= "foreach (\$params as \$key => \$value) {\n\$_smarty_tpl->tpl_vars[\$key] = new Smarty_Variable(\$value, \$_smarty_tpl->isRenderingCache);\n}?>"; + $output .= "foreach (\$params as \$key => \$value) {\n\$_smarty_tpl->tpl_vars[\$key] = new Smarty_Variable(\$value, \$_smarty_tpl->isRenderingCache);\n}\n"; + $output .= $compiler->compileCheckPlugins(array_merge($compiler->required_plugins[ 'compiled' ], $compiler->required_plugins[ 'nocache' ])); + $output .= "?>\n"; $compiler->parser->current_buffer->append_subtree($compiler->parser, new Smarty_Internal_ParseTree_Tag($compiler->parser, $output)); @@ -178,19 +182,10 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase new Smarty_Internal_ParseTree_Tag($compiler->parser, $output)); $compiler->parent_compiler->blockOrFunctionCode .= $compiler->parser->current_buffer->to_smarty_php($compiler->parser); - // nocache plugins must be copied - if (!empty($compiler->template->compiled->required_plugins[ 'nocache' ])) { - foreach ($compiler->template->compiled->required_plugins[ 'nocache' ] as $plugin => $tmp) { - foreach ($tmp as $type => $data) { - $compiler->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin ][ $type ] = - $data; - } - } - } - // restore old buffer - + // restore old buffer $compiler->parser->current_buffer = $saved_data[ 1 ]; // restore old status + $compiler->restoreRequiredPlugins(); $compiler->template->compiled->has_nocache_code = $saved_data[ 2 ]; $compiler->template->caching = $saved_data[ 3 ]; return true; diff --git a/libs/sysplugins/smarty_internal_compile_private_modifier.php b/libs/sysplugins/smarty_internal_compile_private_modifier.php index ad442a3f..e83b7a24 100644 --- a/libs/sysplugins/smarty_internal_compile_private_modifier.php +++ b/libs/sysplugins/smarty_internal_compile_private_modifier.php @@ -130,8 +130,8 @@ class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBa } } } - if (isset($compiler->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $modifier ][ Smarty::PLUGIN_MODIFIER ][ 'file' ]) || - isset($compiler->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $modifier ][ Smarty::PLUGIN_MODIFIER ][ 'file' ]) + if (isset($compiler->required_plugins[ 'nocache' ][ $modifier ][ Smarty::PLUGIN_MODIFIER ][ 'file' ]) || + isset($compiler->required_plugins[ 'compiled' ][ $modifier ][ Smarty::PLUGIN_MODIFIER ][ 'file' ]) ) { // was a plugin $compiler->known_modifier_type[ $modifier ] = 4; diff --git a/libs/sysplugins/smarty_internal_runtime_codeframe.php b/libs/sysplugins/smarty_internal_runtime_codeframe.php index db303e0a..f792496f 100644 --- a/libs/sysplugins/smarty_internal_runtime_codeframe.php +++ b/libs/sysplugins/smarty_internal_runtime_codeframe.php @@ -58,35 +58,9 @@ class Smarty_Internal_Runtime_CodeFrame var_export($_template->smarty->ext->_tplFunction->getTplFunction($_template), true) . ");\n"; } - // include code for plugins - if (!$cache) { - if (!empty($_template->compiled->required_plugins[ 'compiled' ])) { - foreach ($_template->compiled->required_plugins[ 'compiled' ] as $tmp) { - foreach ($tmp as $data) { - $file = addslashes($data[ 'file' ]); - if (is_array($data[ 'function' ])) { - $output .= "if (!is_callable(array('{$data['function'][0]}','{$data['function'][1]}'))) require_once '{$file}';\n"; - } else { - $output .= "if (!is_callable('{$data['function']}')) require_once '{$file}';\n"; - } - } - } - } - if ($_template->caching && !empty($_template->compiled->required_plugins[ 'nocache' ])) { - $_template->compiled->has_nocache_code = true; - $output .= "echo '/*%%SmartyNocache:{$_template->compiled->nocache_hash}%%*/smarty; "; - foreach ($_template->compiled->required_plugins[ 'nocache' ] as $tmp) { - foreach ($tmp as $data) { - $file = addslashes($data[ 'file' ]); - if (is_array($data[ 'function' ])) { - $output .= addslashes("if (!is_callable(array('{$data['function'][0]}','{$data['function'][1]}'))) require_once '{$file}';\n"); - } else { - $output .= addslashes("if (!is_callable('{$data['function']}')) require_once '{$file}';\n"); - } - } - } - $output .= "?>/*/%%SmartyNocache:{$_template->compiled->nocache_hash}%%*/';\n"; - } + // include code for required plugins + if (!$cache && isset($compiler)) { + $output .= $compiler->compileRequiredPlugins(); } $output .= "?>"; $output .= $content; diff --git a/libs/sysplugins/smarty_internal_runtime_tplfunction.php b/libs/sysplugins/smarty_internal_runtime_tplfunction.php index f6b36f2a..b86563cb 100644 --- a/libs/sysplugins/smarty_internal_runtime_tplfunction.php +++ b/libs/sysplugins/smarty_internal_runtime_tplfunction.php @@ -120,15 +120,13 @@ class Smarty_Internal_Runtime_TplFunction } // add template function code to cache file if (isset($tplPtr->cached)) { - /* @var Smarty_Template_Cached $cache */ - $cache = $tplPtr->cached; - $content = $cache->read($tplPtr); + $content = $tplPtr->cached->read($tplPtr); if ($content) { // check if we must update file dependency if (!preg_match("/'{$funcParam['uid']}'(.*?)'nocache_hash'/", $content, $match2)) { $content = preg_replace("/('file_dependency'(.*?)\()/", "\\1{$match1[0]}", $content); } - $tplPtr->smarty->ext->_updateCache->write($cache, $tplPtr, + $tplPtr->smarty->ext->_updateCache->write($tplPtr, preg_replace('/\s*\?>\s*$/', "\n", $content) . "\n" . preg_replace(array('/^\s*<\?php\s+/', '/\s*\?>\s*$/',), "\n", diff --git a/libs/sysplugins/smarty_internal_runtime_updatecache.php b/libs/sysplugins/smarty_internal_runtime_updatecache.php index a3cd21dd..bb3e4e13 100644 --- a/libs/sysplugins/smarty_internal_runtime_updatecache.php +++ b/libs/sysplugins/smarty_internal_runtime_updatecache.php @@ -115,41 +115,43 @@ class Smarty_Internal_Runtime_UpdateCache $content = $_template->smarty->ext->_filterHandler->runFilter('output', $content, $_template); } // write cache file content - $this->writeCachedContent($cached, $_template, $content); + $this->writeCachedContent($_template, $content); } /** * Writes the content to cache resource * - * @param \Smarty_Template_Cached $cached * @param Smarty_Internal_Template $_template * @param string $content * * @return bool */ - public function writeCachedContent(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $content) + public function writeCachedContent(Smarty_Internal_Template $_template, $content) { if ($_template->source->handler->recompiled || !$_template->caching ) { // don't write cache file return false; } + if (!isset($_template->cached)) { + $_template->loadCached(); + } $content = $_template->smarty->ext->_codeFrame->create($_template, $content, '', true); - return $this->write($cached, $_template, $content); + return $this->write($_template, $content); } /** * Write this cache object to handler * - * @param \Smarty_Template_Cached $cached * @param Smarty_Internal_Template $_template template object * @param string $content content to cache * * @return bool success */ - public function write(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $content) + public function write(Smarty_Internal_Template $_template, $content) { if (!$_template->source->handler->recompiled) { + $cached = $_template->cached; if ($cached->handler->writeCachedContent($_template, $content)) { $cached->content = null; $cached->timestamp = time(); @@ -160,6 +162,7 @@ class Smarty_Internal_Runtime_UpdateCache if ($_template->smarty->cache_locking) { $cached->handler->releaseLock($_template->smarty, $cached); } + return true; } $cached->content = null; @@ -168,6 +171,7 @@ class Smarty_Internal_Runtime_UpdateCache $cached->valid = false; $cached->processed = false; } + return false; } } \ No newline at end of file diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index ae321725..21f60f99 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -234,15 +234,6 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase $this->smarty->_debug->display_debug($this, true); } } - if ($this->_isSubTpl()) { - foreach ($this->compiled->required_plugins as $code => $tmp1) { - foreach ($tmp1 as $name => $tmp) { - foreach ($tmp as $type => $data) { - $this->parent->compiled->required_plugins[ $code ][ $name ][ $type ] = $data; - } - } - } - } if (!$no_output_filter && (!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled) && (isset($this->smarty->autoload_filters[ 'output' ]) || @@ -428,6 +419,39 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase } } + /** + * Check if plugins are callable require file otherwise + * + * @param array $plugins required plugins + * + * @throws \SmartyException + */ + public function _checkPlugins($plugins) { + static $checked = array(); + foreach($plugins as $plugin) { + $name = join('::', (array)$plugin[ 'function' ]); + if (!isset($checked[$name])) { + if (!is_callable($plugin['function'])) { + if (is_file($plugin['file'])) { + require_once $plugin['file']; + if (is_callable($plugin['function'])) { + $checked[ $name ] = true; + } + } + } else { + $checked[ $name ] = true; + } + } + if (!isset($checked[ $name ])) { + if (false !== $this->smarty->loadPlugin($name)) { + $checked[ $name ] = true; + } else { + throw new SmartyException("Plugin '{$name}' not callable"); + } + } + } + } + /** * This function is executed automatically when a compiled or cached template file is included * - Decode saved properties from compiled template and cache files @@ -523,7 +547,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase */ public function writeCachedContent($content) { - return $this->smarty->ext->_updateCache->writeCachedContent($this->cached, $this, $content); + return $this->smarty->ext->_updateCache->writeCachedContent($this, $content); } /** diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index d4b0fab4..0d7284a0 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -57,6 +57,14 @@ abstract class Smarty_Internal_TemplateCompilerBase * @var bool */ public $suppressNocacheProcessing = false; + + /** + * caching enabled (copied from template object) + * + * @var int + */ + public $caching = 0; + /** * tag stack * @@ -69,6 +77,18 @@ abstract class Smarty_Internal_TemplateCompilerBase * @var array */ public $_tag_stack_count = array(); + /** + * Plugins used by template + * + * @var array + */ + public $required_plugins = array('compiled' => array(), 'nocache' => array()); + /** + * Required plugins stack + * + * @var array + */ + public $required_plugins_stack = array(); /** * current template * @@ -374,6 +394,7 @@ abstract class Smarty_Internal_TemplateCompilerBase } else { $this->nocache_hash = $template->compiled->nocache_hash; } + $this->caching = $template->caching; // flag for nocache sections $this->nocache = $nocache; $this->tag_nocache = false; @@ -711,25 +732,25 @@ abstract class Smarty_Internal_TemplateCompilerBase public function getPlugin($plugin_name, $plugin_type) { $function = null; - if ($this->template->caching && ($this->nocache || $this->tag_nocache)) { - if (isset($this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ])) { + if ($this->caching && ($this->nocache || $this->tag_nocache)) { + if (isset($this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ])) { $function = - $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'function' ]; - } else if (isset($this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ])) { - $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ] = - $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ]; + $this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'function' ]; + } else if (isset($this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ])) { + $this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ] = + $this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ]; $function = - $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'function' ]; + $this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'function' ]; } } else { - if (isset($this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ])) { + if (isset($this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ])) { $function = - $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'function' ]; - } else if (isset($this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ])) { - $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ] = - $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ]; + $this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'function' ]; + } else if (isset($this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ])) { + $this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ] = + $this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ]; $function = - $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'function' ]; + $this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'function' ]; } } if (isset($function)) { @@ -742,15 +763,15 @@ abstract class Smarty_Internal_TemplateCompilerBase $function = 'smarty_' . $plugin_type . '_' . $plugin_name; $file = $this->smarty->loadPlugin($function, false); if (is_string($file)) { - if ($this->template->caching && ($this->nocache || $this->tag_nocache)) { - $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'file' ] = + if ($this->caching && ($this->nocache || $this->tag_nocache)) { + $this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'file' ] = $file; - $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'function' ] = + $this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'function' ] = $function; } else { - $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'file' ] = + $this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'file' ] = $file; - $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'function' ] = + $this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'function' ] = $function; } if ($plugin_type === 'modifier') { @@ -790,15 +811,15 @@ abstract class Smarty_Internal_TemplateCompilerBase $this->tag_nocache = $this->tag_nocache || !$cacheable; if ($script !== null) { if (is_file($script)) { - if ($this->template->caching && ($this->nocache || $this->tag_nocache)) { - $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $tag ][ $plugin_type ][ 'file' ] = + if ($this->caching && ($this->nocache || $this->tag_nocache)) { + $this->required_plugins[ 'nocache' ][ $tag ][ $plugin_type ][ 'file' ] = $script; - $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $tag ][ $plugin_type ][ 'function' ] = + $this->required_plugins[ 'nocache' ][ $tag ][ $plugin_type ][ 'function' ] = $callback; } else { - $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $tag ][ $plugin_type ][ 'file' ] = + $this->required_plugins[ 'compiled' ][ $tag ][ $plugin_type ][ 'file' ] = $script; - $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $tag ][ $plugin_type ][ 'function' ] = + $this->required_plugins[ 'compiled' ][ $tag ][ $plugin_type ][ 'function' ] = $callback; } require_once $script; @@ -853,7 +874,7 @@ abstract class Smarty_Internal_TemplateCompilerBase // If the template is not evaluated and we have a nocache section and or a nocache tag if ($is_code && !empty($content)) { // generate replacement code - if ((!($this->template->source->handler->recompiled) || $this->forceNocache) && $this->template->caching && + if ((!($this->template->source->handler->recompiled) || $this->forceNocache) && $this->caching && !$this->suppressNocacheProcessing && ($this->nocache || $this->tag_nocache) ) { $this->template->compiled->has_nocache_code = true; @@ -862,9 +883,9 @@ abstract class Smarty_Internal_TemplateCompilerBase $_output = "nocache_hash}%%*/{$_output}/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>\n"; // make sure we include modifier plugins for nocache code foreach ($this->modifier_plugins as $plugin_name => $dummy) { - if (isset($this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ 'modifier' ])) { - $this->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $plugin_name ][ 'modifier' ] = - $this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ 'modifier' ]; + if (isset($this->required_plugins[ 'compiled' ][ $plugin_name ][ 'modifier' ])) { + $this->required_plugins[ 'nocache' ][ $plugin_name ][ 'modifier' ] = + $this->required_plugins[ 'compiled' ][ $plugin_name ][ 'modifier' ]; } } } else { @@ -1266,6 +1287,65 @@ abstract class Smarty_Internal_TemplateCompilerBase return $code; } + /** + * Save current required plugins + * + * @param bool $init if true init required plugins + */ + public function saveRequiredPlugins($init=false) + { + $this->required_plugins_stack[] = $this->required_plugins; + if ($init) { + $this->required_plugins = array('compiled' => array(), 'nocache' => array()); + } + } + + /** + * Restore required plugins + */ + public function restoreRequiredPlugins() + { + $this->required_plugins = array_pop($this->required_plugins_stack); + } + + /** + * Compile code to call Smarty_Internal_Template::_checkPlugins() + * for required plugins + * + * @return string + */ + public function compileRequiredPlugins() + { + $code = $this->compileCheckPlugins($this->required_plugins[ 'compiled' ]); + if ($this->caching && !empty($this->required_plugins[ 'nocache' ])) { + $code .= $this->makeNocacheCode($this->compileCheckPlugins($this->required_plugins[ 'nocache' ])); + } + return $code; + } + + /** + * Compile code to call Smarty_Internal_Template::_checkPlugins + * - checks if plugin is callable require otherwise + * + * @param $requiredPlugins + * + * @return string + */ + public function compileCheckPlugins($requiredPlugins) + { + if (!empty($requiredPlugins)) { + $plugins = array(); + foreach ($requiredPlugins as $plugin) { + foreach ($plugin as $data) { + $plugins[] = $data; + } + } + return '$_smarty_tpl->_checkPlugins(' . $this->getVarExport($plugins) . ');' . "\n"; + } else { + return ''; + } + } + /** * method to compile a Smarty template * diff --git a/libs/sysplugins/smarty_template_resource_base.php b/libs/sysplugins/smarty_template_resource_base.php index eb262ab0..951e02af 100644 --- a/libs/sysplugins/smarty_template_resource_base.php +++ b/libs/sysplugins/smarty_template_resource_base.php @@ -72,13 +72,6 @@ abstract class Smarty_Template_Resource_Base */ public $content = null; - /** - * required plugins - * - * @var array - */ - public $required_plugins = array(); - /** * Included sub templates * - index name From 860ebb618e621e4560ea05c17f198582b727bf7f Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Wed, 28 Mar 2018 07:35:52 +0200 Subject: [PATCH 11/31] - bugfix plugins may not be loaded if {function} or {block} tags are executed in nocache mode --- libs/plugins/block.textformat.php | 15 ++++++-------- libs/plugins/function.html_checkboxes.php | 14 ++++++------- libs/plugins/function.html_image.php | 8 +++----- libs/plugins/function.html_options.php | 8 +++----- libs/plugins/function.html_radios.php | 10 ++++----- libs/plugins/function.html_select_date.php | 14 +++++-------- libs/plugins/function.html_select_time.php | 14 +++++-------- libs/plugins/modifier.escape.php | 22 ++++++++++++-------- libs/plugins/modifiercompiler.escape.php | 24 +++++++++------------- 9 files changed, 55 insertions(+), 74 deletions(-) diff --git a/libs/plugins/block.textformat.php b/libs/plugins/block.textformat.php index a363b07f..310a420e 100644 --- a/libs/plugins/block.textformat.php +++ b/libs/plugins/block.textformat.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsBlock */ - /** * Smarty {textformat}{/textformat} block plugin * Type: block function @@ -20,7 +19,7 @@ * - wrap_char - string ("\n") * - indent_char - string (" ") * - wrap_boundary - boolean (true) - * + * * * @link http://www.smarty.net/manual/en/language.function.textformat.php {textformat} * (Smarty online manual) @@ -32,18 +31,16 @@ * * @return string content re-formatted * @author Monte Ohrt + * @throws \SmartyException */ -function smarty_block_textformat($params, $content, $template, &$repeat) +function smarty_block_textformat($params, $content, Smarty_Internal_Template $template, &$repeat) { - static $mb_wordwrap_loaded = false; if (is_null($content)) { return; } - if (Smarty::$_MBSTRING && !$mb_wordwrap_loaded) { - if (!is_callable('smarty_modifier_mb_wordwrap')) { - require_once(SMARTY_PLUGINS_DIR . 'modifier.mb_wordwrap.php'); - } - $mb_wordwrap_loaded = true; + if (Smarty::$_MBSTRING) { + $template->_checkPlugins(array(array('function' => 'smarty_modifier_mb_wordwrap', + 'file' => SMARTY_PLUGINS_DIR . 'modifier.mb_wordwrap.php'))); } $style = null; diff --git a/libs/plugins/function.html_checkboxes.php b/libs/plugins/function.html_checkboxes.php index 9145d8b3..d654caba 100644 --- a/libs/plugins/function.html_checkboxes.php +++ b/libs/plugins/function.html_checkboxes.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsFunction */ - /** * Smarty {html_checkboxes} function plugin * File: function.html_checkboxes.php @@ -37,18 +36,17 @@ * @author credits to Monte Ohrt * @version 1.0 * - * @param array $params parameters - * @param object $template template object + * @param array $params parameters + * @param Smarty_Internal_Template $template template object * * @return string * @uses smarty_function_escape_special_chars() + * @throws \SmartyException */ -function smarty_function_html_checkboxes($params, $template) +function smarty_function_html_checkboxes($params, Smarty_Internal_Template $template) { - if (!isset($template->smarty->_cache[ '_required_sesc' ])) { - require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'); - $template->smarty->_cache[ '_required_sesc' ] = true; - } + $template->_checkPlugins(array(array('function' => 'smarty_function_escape_special_chars', + 'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'))); $name = 'checkbox'; $values = null; diff --git a/libs/plugins/function.html_image.php b/libs/plugins/function.html_image.php index fda3ff34..4fda72ee 100644 --- a/libs/plugins/function.html_image.php +++ b/libs/plugins/function.html_image.php @@ -36,12 +36,10 @@ * @return string * @uses smarty_function_escape_special_chars() */ -function smarty_function_html_image($params, $template) +function smarty_function_html_image($params, Smarty_Internal_Template $template) { - if (!isset($template->smarty->_cache[ '_required_sesc' ])) { - require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'); - $template->smarty->_cache[ '_required_sesc' ] = true; - } + $template->_checkPlugins(array(array('function' => 'smarty_function_escape_special_chars', + 'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'))); $alt = ''; $file = ''; diff --git a/libs/plugins/function.html_options.php b/libs/plugins/function.html_options.php index d3c2768b..b8b98649 100644 --- a/libs/plugins/function.html_options.php +++ b/libs/plugins/function.html_options.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsFunction */ - /** * Smarty {html_options} function plugin * Type: function @@ -34,13 +33,12 @@ * * @return string * @uses smarty_function_escape_special_chars() + * @throws \SmartyException */ function smarty_function_html_options($params, Smarty_Internal_Template $template) { - if (!isset($template->smarty->_cache[ '_required_sesc' ])) { - require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'); - $template->smarty->_cache[ '_required_sesc' ] = true; - } + $template->_checkPlugins(array(array('function' => 'smarty_function_escape_special_chars', + 'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'))); $name = null; $values = null; diff --git a/libs/plugins/function.html_radios.php b/libs/plugins/function.html_radios.php index 8678ec7d..37feec63 100644 --- a/libs/plugins/function.html_radios.php +++ b/libs/plugins/function.html_radios.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsFunction */ - /** * Smarty {html_radios} function plugin * File: function.html_radios.php @@ -42,13 +41,12 @@ * * @return string * @uses smarty_function_escape_special_chars() + * @throws \SmartyException */ -function smarty_function_html_radios($params, $template) +function smarty_function_html_radios($params, Smarty_Internal_Template $template) { - if (!isset($template->smarty->_cache[ '_required_sesc' ])) { - require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'); - $template->smarty->_cache[ '_required_sesc' ] = true; - } + $template->_checkPlugins(array(array('function' => 'smarty_function_escape_special_chars', + 'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'))); $name = 'radio'; $values = null; diff --git a/libs/plugins/function.html_select_date.php b/libs/plugins/function.html_select_date.php index d894435f..1d63800e 100644 --- a/libs/plugins/function.html_select_date.php +++ b/libs/plugins/function.html_select_date.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsFunction */ - /** * Smarty {html_select_date} plugin * Type: function @@ -42,17 +41,12 @@ * @param \Smarty_Internal_Template $template * * @return string + * @throws \SmartyException */ function smarty_function_html_select_date($params, Smarty_Internal_Template $template) { - if (!isset($template->smarty->_cache[ '_required_sesc' ])) { - require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'); - $template->smarty->_cache[ '_required_sesc' ] = true; - } - if (!isset($template->smarty->_cache[ '_required_smt' ])) { - require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php'); - $template->smarty->_cache[ '_required_smt' ] = true; - } + $template->_checkPlugins(array(array('function' => 'smarty_function_escape_special_chars', + 'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'))); // generate timestamps used for month names only static $_month_timestamps = null; static $_current_year = null; @@ -117,6 +111,8 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem switch ($_key) { case 'time': if (!is_array($_value) && $_value !== null) { + $template->_checkPlugins(array(array('function' => 'smarty_make_timestamp', + 'file' => SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php'))); $time = smarty_make_timestamp($_value); } break; diff --git a/libs/plugins/function.html_select_time.php b/libs/plugins/function.html_select_time.php index 8972c426..f7c3816e 100644 --- a/libs/plugins/function.html_select_time.php +++ b/libs/plugins/function.html_select_time.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsFunction */ - /** * Smarty {html_select_time} function plugin * Type: function @@ -23,17 +22,12 @@ * * @return string * @uses smarty_make_timestamp() + * @throws \SmartyException */ function smarty_function_html_select_time($params, Smarty_Internal_Template $template) { - if (!isset($template->smarty->_cache[ '_required_sesc' ])) { - require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'); - $template->smarty->_cache[ '_required_sesc' ] = true; - } - if (!isset($template->smarty->_cache[ '_required_smt' ])) { - require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php'); - $template->smarty->_cache[ '_required_smt' ] = true; - } + $template->_checkPlugins(array(array('function' => 'smarty_function_escape_special_chars', + 'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'))); $prefix = 'Time_'; $field_array = null; $field_separator = "\n"; @@ -84,6 +78,8 @@ function smarty_function_html_select_time($params, Smarty_Internal_Template $tem switch ($_key) { case 'time': if (!is_array($_value) && $_value !== null) { + $template->_checkPlugins(array(array('function' => 'smarty_make_timestamp', + 'file' => SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php'))); $time = smarty_make_timestamp($_value); } break; diff --git a/libs/plugins/modifier.escape.php b/libs/plugins/modifier.escape.php index a1c4682c..1ae87a7a 100644 --- a/libs/plugins/modifier.escape.php +++ b/libs/plugins/modifier.escape.php @@ -25,7 +25,8 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $double_encode = true) { static $_double_encode = null; - static $is_loaded1 = false; + static $is_loaded_1 = false; + static $is_loaded_2 = false; if ($_double_encode === null) { $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>='); } @@ -123,11 +124,11 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ case 'hexentity': $return = ''; if (Smarty::$_MBSTRING) { - if (!$is_loaded1) { + if (!$is_loaded_1) { if (!is_callable('smarty_mb_to_unicode')) { require_once(SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php'); - $is_loaded1 = true; } + $is_loaded_1 = true; } $return = ''; foreach (smarty_mb_to_unicode($string, Smarty::$_CHARSET) as $unicode) { @@ -147,11 +148,11 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ case 'decentity': $return = ''; if (Smarty::$_MBSTRING) { - if (!$is_loaded1) { + if (!$is_loaded_1) { if (!is_callable('smarty_mb_to_unicode')) { require_once(SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php'); } - $is_loaded1 = true; + $is_loaded_1 = true; } $return = ''; foreach (smarty_mb_to_unicode($string, Smarty::$_CHARSET) as $unicode) { @@ -179,8 +180,11 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ case 'mail': if (Smarty::$_MBSTRING) { - if (!is_callable('smarty_mb_str_replace')) { - require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php'); + if (!$is_loaded_2) { + if (!is_callable('smarty_mb_str_replace')) { + require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php'); + } + $is_loaded_2 = true; } return smarty_mb_str_replace(array('@', '.'), array(' [AT] ', @@ -195,11 +199,11 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ // escape non-standard chars, such as ms document quotes $return = ''; if (Smarty::$_MBSTRING) { - if (!$is_loaded1) { + if (!$is_loaded_1) { if (!is_callable('smarty_mb_to_unicode')) { require_once(SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php'); } - $is_loaded1 = true; + $is_loaded_1 = true; } foreach (smarty_mb_to_unicode($string, Smarty::$_CHARSET) as $unicode) { if ($unicode >= 126) { diff --git a/libs/plugins/modifiercompiler.escape.php b/libs/plugins/modifiercompiler.escape.php index 62a1b8be..6a6e0163 100644 --- a/libs/plugins/modifiercompiler.escape.php +++ b/libs/plugins/modifiercompiler.escape.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty escape modifier plugin * Type: modifier @@ -15,21 +14,18 @@ * @link http://www.smarty.net/docsv2/en/language.modifier.escape count_characters (Smarty online manual) * @author Rodney Rehm * - * @param array $params parameters - * @param $compiler + * @param array $params parameters + * @param Smarty_Internal_TemplateCompilerBase $compiler * * @return string with compiled code + * @throws \SmartyException */ -function smarty_modifiercompiler_escape($params, $compiler) +function smarty_modifiercompiler_escape($params, Smarty_Internal_TemplateCompilerBase $compiler) { static $_double_encode = null; static $is_loaded = false; - if (!$is_loaded) { - if (!is_callable('smarty_literal_compiler_param')) { - require_once(SMARTY_PLUGINS_DIR . 'shared.literal_compiler_param.php'); - } - $is_loaded = true; - } + $compiler->template->_checkPlugins(array(array('function' => 'smarty_literal_compiler_param', + 'file' => SMARTY_PLUGINS_DIR . 'shared.literal_compiler_param.php'))); if ($_double_encode === null) { $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>='); } @@ -104,14 +100,14 @@ function smarty_modifiercompiler_escape($params, $compiler) // could not optimize |escape call, so fallback to regular plugin if ($compiler->template->caching && ($compiler->tag_nocache | $compiler->nocache)) { - $compiler->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ 'escape' ][ 'modifier' ][ 'file' ] = + $compiler->required_plugins[ 'nocache' ][ 'escape' ][ 'modifier' ][ 'file' ] = SMARTY_PLUGINS_DIR . 'modifier.escape.php'; - $compiler->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ 'escape' ][ 'modifier' ][ 'function' ] = + $compiler->required_plugins[ 'nocache' ][ 'escape' ][ 'modifier' ][ 'function' ] = 'smarty_modifier_escape'; } else { - $compiler->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ 'escape' ][ 'modifier' ][ 'file' ] = + $compiler->required_plugins[ 'compiled' ][ 'escape' ][ 'modifier' ][ 'file' ] = SMARTY_PLUGINS_DIR . 'modifier.escape.php'; - $compiler->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ 'escape' ][ 'modifier' ][ 'function' ] = + $compiler->required_plugins[ 'compiled' ][ 'escape' ][ 'modifier' ][ 'function' ] = 'smarty_modifier_escape'; } From b2d55b677dd8c6ee862cd7135ac8c1676c090c97 Mon Sep 17 00:00:00 2001 From: Dusta Date: Sat, 14 Apr 2018 20:32:35 +0200 Subject: [PATCH 12/31] Update README.md Add https, add dots --- README.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 3ba4d0c0..24baae4c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ # Smarty 3 template engine -www.smarty.net +[smarty.net](https://www.smarty.net/) ## Documentation For documentation see -www.smarty.net/docs/en/ +[www.smarty.net/docs/en/](https://www.smarty.net/docs/en/) + ## Distribution repository > Smarty 3.1.28 introduces run time template inheritance @@ -16,7 +17,7 @@ Smarty versions 3.1.11 or later are now on github and can be installed with Comp The "smarty/smarty" package will start at libs/.... subfolder. -To get the latest stable version of Smarty 3.1 use +To get the latest stable version of Smarty 3.1 use: ```json "require": { @@ -26,7 +27,7 @@ To get the latest stable version of Smarty 3.1 use in your composer.json file. -To get the trunk version use +To get the trunk version use: ```json "require": { @@ -34,7 +35,7 @@ To get the trunk version use } ``` -For a specific version use something like +For a specific version use something like: ```json "require": { @@ -42,7 +43,7 @@ For a specific version use something like } ``` -PHPUnit test can be installed by corresponding composer entries like +PHPUnit test can be installed by corresponding composer entries like: ```json "require": { @@ -50,7 +51,7 @@ PHPUnit test can be installed by corresponding composer entries like } ``` -Similar applies for the lexer/parser generator +Similar applies for the lexer/parser generator. ```json "require": { @@ -58,7 +59,7 @@ Similar applies for the lexer/parser generator } ``` -Or you could use +Or you could use: ```json "require": { @@ -66,6 +67,6 @@ Or you could use } ``` -Which is a wrapper to install all 3 packages +Which is a wrapper to install all 3 packages. -Composer can also be used for Smarty2 versions 2.6.24 to 2.6.30 +Composer can also be used for Smarty2 versions 2.6.24 to 2.6.30. From 8bea607b78cbd9297426af874dbab23590048c5b Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Mon, 16 Apr 2018 10:25:47 +0200 Subject: [PATCH 13/31] fix comment lines of inline subtemplates --- libs/sysplugins/smarty_internal_compile_include.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/sysplugins/smarty_internal_compile_include.php b/libs/sysplugins/smarty_internal_compile_include.php index 217fb8f8..70f22546 100644 --- a/libs/sysplugins/smarty_internal_compile_include.php +++ b/libs/sysplugins/smarty_internal_compile_include.php @@ -295,12 +295,12 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase $tpl->mustCompile = true; $compiler->parent_compiler->mergedSubTemplatesData[ $uid ][ $t_hash ][ 'nocache_hash' ] = $tpl->compiled->nocache_hash; - if ($compiler->template->source->type === 'file') { - $sourceInfo = $compiler->template->source->filepath; + if ($tpl->source->type === 'file') { + $sourceInfo = $tpl->source->filepath; } else { - $basename = $compiler->template->source->handler->getBasename($compiler->template->source); - $sourceInfo = $compiler->template->source->type . ':' . - ($basename ? $basename : $compiler->template->source->name); + $basename = $tpl->source->handler->getBasename($tpl->source); + $sourceInfo = $tpl->source->type . ':' . + ($basename ? $basename : $tpl->source->name); } // get compiled code $compiled_code = " Date: Thu, 19 Apr 2018 16:04:41 +0200 Subject: [PATCH 14/31] update access to parent object --- .../smarty_internal_method_gettemplatevars.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libs/sysplugins/smarty_internal_method_gettemplatevars.php b/libs/sysplugins/smarty_internal_method_gettemplatevars.php index 1759646f..510bab0f 100644 --- a/libs/sysplugins/smarty_internal_method_gettemplatevars.php +++ b/libs/sysplugins/smarty_internal_method_gettemplatevars.php @@ -53,7 +53,7 @@ class Smarty_Internal_Method_GetTemplateVars } } // not found, try at parent - if ($searchParents) { + if ($searchParents && isset($_ptr->parent)) { $_ptr = $_ptr->parent; } else { $_ptr = null; @@ -93,7 +93,7 @@ class Smarty_Internal_Method_GetTemplateVars return $_ptr->tpl_vars[ $varName ]; } // not found, try at parent - if ($searchParents) { + if ($searchParents && isset($_ptr->parent)) { $_ptr = $_ptr->parent; } else { $_ptr = null; @@ -103,14 +103,11 @@ class Smarty_Internal_Method_GetTemplateVars // found it, return it return Smarty::$global_tpl_vars[ $varName ]; } - /* @var \Smarty $smarty */ - $smarty = isset($data->smarty) ? $data->smarty : $data; - if ($smarty->error_unassigned && $errorEnable) { + if ($errorEnable && $data->_getSmartyObj()->error_unassigned) { // force a notice $x = $$varName; } return new Smarty_Undefined_Variable; } - } \ No newline at end of file From 8d21f38dc35c4cd6b31c2f23fc9b8e5adbc56dfe Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Tue, 24 Apr 2018 10:38:18 +0200 Subject: [PATCH 15/31] - bugfix possible Security Vulnerability in Smarty_Security class. --- change_log.txt | 3 + libs/Smarty.class.php | 24 ++++--- libs/sysplugins/smarty_security.php | 107 ++++++++++++++-------------- 3 files changed, 73 insertions(+), 61 deletions(-) diff --git a/change_log.txt b/change_log.txt index f92af840..a3ebcc36 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== 3.1.32 - dev === +24.04.2018 + - bugfix possible Security Vulnerability in Smarty_Security class. + 26.03.2018 - bugfix plugins may not be loaded if {function} or {block} tags are executed in nocache mode https://github.com/smarty-php/smarty/issues/371 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index d9e96703..aba24441 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.32-dev-45'; + const SMARTY_VERSION = '3.1.32-dev-46'; /** * define variable scopes */ @@ -1042,9 +1042,15 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function _realpath($path, $realpath = null) { - $nds = DIRECTORY_SEPARATOR === '/' ? '\\' : '/'; + static $nds = array('/' => '\\', '\\' => '/'); + static $sepDotsep = DIRECTORY_SEPARATOR . '.' . DIRECTORY_SEPARATOR; + static $sepDot = DIRECTORY_SEPARATOR . '.'; + static $sepSep = DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR; // normalize DIRECTORY_SEPARATOR - $path = str_replace($nds, DIRECTORY_SEPARATOR, $path); + $path = str_replace(array($nds[DIRECTORY_SEPARATOR], $sepDotsep), DIRECTORY_SEPARATOR, $path); + if (strpos($path,$sepDot) === false && (($realpath === false && $path[0] === '.') || $realpath === null) && $path[0] !== '\\') { + return $path; + } preg_match('%^(?(?:[[:alpha:]]:[\\\\]|/|[\\\\]{2}[[:alpha:]]+|[[:print:]]{2,}:[/]{2}|[\\\\])?)(?(.*))$%u', $path, $parts); @@ -1056,11 +1062,11 @@ class Smarty extends Smarty_Internal_TemplateBase $path = getcwd() . DIRECTORY_SEPARATOR . $path; } } - // remove noop 'DIRECTORY_SEPARATOR DIRECTORY_SEPARATOR' and 'DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR' patterns - $path = preg_replace('#([\\\\/]([.]?[\\\\/])+)#u', DIRECTORY_SEPARATOR, $path); + // remove noop 'DIRECTORY_SEPARATOR DIRECTORY_SEPARATOR' and 'DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR' patterns + $path = str_replace(array($sepDotsep,$sepSep), DIRECTORY_SEPARATOR, $path); // resolve '..DIRECTORY_SEPARATOR' pattern, smallest first if (strpos($path, '..' . DIRECTORY_SEPARATOR) !== false && - preg_match_all('#(([.]?[\\\\/])*([.][.])[\\\\/]([.]?[\\\\/])*)+#u', $path, $match) + preg_match_all('#[\\\\/]([.][.][\\\\/])+#u', $path, $match) ) { $counts = array(); foreach ($match[ 0 ] as $m) { @@ -1068,13 +1074,13 @@ class Smarty extends Smarty_Internal_TemplateBase } sort($counts); foreach ($counts as $count) { - $path = preg_replace('#(([\\\\/]([.]?[\\\\/])*[^\\\\/.]+){' . $count . - '}[\\\\/]([.]?[\\\\/])*([.][.][\\\\/]([.]?[\\\\/])*){' . $count . '})(?=[^.])#u', + $path = preg_replace('#([\\\\/]+[^\\\\/]+){' . $count . + '}[\\\\/]+([.][.][\\\\/]+){' . $count . '}#u', DIRECTORY_SEPARATOR, $path); } } - return $parts[ 'root' ] . $path; + return $realpath !== false ? $parts[ 'root' ] . $path : str_ireplace(getcwd(), '.', $parts[ 'root' ] . $path); } /** diff --git a/libs/sysplugins/smarty_security.php b/libs/sysplugins/smarty_security.php index e501cd82..126f6fb4 100644 --- a/libs/sysplugins/smarty_security.php +++ b/libs/sysplugins/smarty_security.php @@ -514,60 +514,39 @@ class Smarty_Security public function isTrustedResourceDir($filepath, $isConfig = null) { if ($this->_include_path_status !== $this->smarty->use_include_path) { - foreach ($this->_include_dir as $directory) { - unset($this->_resource_dir[ $directory ]); - } - if ($this->smarty->use_include_path) { - $this->_include_dir = array(); - $_dirs = $this->smarty->ext->_getIncludePath->getIncludePathDirs($this->smarty); - foreach ($_dirs as $directory) { - $this->_include_dir[] = $directory; - $this->_resource_dir[ $directory ] = true; - } + $_dir = $this->smarty->use_include_path ? $this->smarty->ext->_getIncludePath->getIncludePathDirs($this->smarty) : array(); + if ($this->_include_dir !== $_dir) { + $this->_updateResourceDir($this->_include_dir, $_dir); + $this->_include_dir = $_dir; } $this->_include_path_status = $this->smarty->use_include_path; } - if ($isConfig !== true && - (!isset($this->smarty->_cache[ 'template_dir_new' ]) || $this->smarty->_cache[ 'template_dir_new' ]) - ) { + if ($isConfig !== true) { $_dir = $this->smarty->getTemplateDir(); if ($this->_template_dir !== $_dir) { - foreach ($this->_template_dir as $directory) { - unset($this->_resource_dir[ $directory ]); - } - foreach ($_dir as $directory) { - $this->_resource_dir[ $directory ] = true; - } + $this->_updateResourceDir($this->_template_dir, $_dir); $this->_template_dir = $_dir; } - $this->smarty->_cache[ 'template_dir_new' ] = false; } - if ($isConfig !== false && - (!isset($this->smarty->_cache[ 'config_dir_new' ]) || $this->smarty->_cache[ 'config_dir_new' ]) - ) { + if ($isConfig !== false) { $_dir = $this->smarty->getConfigDir(); if ($this->_config_dir !== $_dir) { - foreach ($this->_config_dir as $directory) { - unset($this->_resource_dir[ $directory ]); - } - foreach ($_dir as $directory) { - $this->_resource_dir[ $directory ] = true; - } + $this->_updateResourceDir($this->_config_dir, $_dir); $this->_config_dir = $_dir; } - $this->smarty->_cache[ 'config_dir_new' ] = false; } - if ($this->_secure_dir !== (array) $this->secure_dir) { - foreach ($this->_secure_dir as $directory) { - unset($this->_resource_dir[ $directory ]); + if ($this->_secure_dir !== $this->secure_dir) { + $this->secure_dir = (array)$this->secure_dir; + foreach($this->secure_dir as $k => $d) { + $this->secure_dir[$k] = $this->smarty->_realpath($d.DIRECTORY_SEPARATOR,true); } - foreach ((array) $this->secure_dir as $directory) { - $directory = $this->smarty->_realpath($directory . DIRECTORY_SEPARATOR, true); - $this->_resource_dir[ $directory ] = true; - } - $this->_secure_dir = (array) $this->secure_dir; + $this->_updateResourceDir($this->_secure_dir, $this->secure_dir); + $this->_secure_dir = $this->secure_dir; + } + $addPath = $this->_checkDir($filepath, $this->_resource_dir); + if ($addPath !== false) { + $this->_resource_dir = array_merge($this->_resource_dir, $addPath); } - $this->_resource_dir = $this->_checkDir($filepath, $this->_resource_dir); return true; } @@ -622,40 +601,64 @@ class Smarty_Security $this->_php_resource_dir[ $directory ] = true; } } - - $this->_php_resource_dir = - $this->_checkDir($this->smarty->_realpath($filepath, true), $this->_php_resource_dir); - return true; + $addPath = $this->_checkDir($filepath, $this->_php_resource_dir); + if ($addPath !== false) { + $this->_php_resource_dir = array_merge($this->_php_resource_dir, $addPath); + } + return true; } + /** + * Remove old directories and its sub folders, add new directories + * + * @param array $oldDir + * @param array $newDir + */ + private function _updateResourceDir($oldDir, $newDir) { + foreach ($oldDir as $directory) { + $directory = $this->smarty->_realpath($directory, true); + $length = strlen($directory); + foreach ($this->_resource_dir as $dir) { + if (substr($dir, 0,$length) === $directory) { + unset($this->_resource_dir[ $dir ]); + } + } + } + foreach ($newDir as $directory) { + $directory = $this->smarty->_realpath($directory, true); + $this->_resource_dir[ $directory ] = true; + } + } /** * Check if file is inside a valid directory * * @param string $filepath * @param array $dirs valid directories * - * @return array + * @return array|bool * @throws \SmartyException */ private function _checkDir($filepath, $dirs) { + $directory = dirname($filepath) . DIRECTORY_SEPARATOR; + if (isset($dirs[ $directory ])) { + return false; + } + $filepath = $this->smarty->_realpath($filepath, true); $directory = dirname($filepath) . DIRECTORY_SEPARATOR; $_directory = array(); while (true) { - // remember the directory to add it to _resource_dir in case we're successful - $_directory[ $directory ] = true; - // test if the directory is trusted + // test if the directory is trusted if (isset($dirs[ $directory ])) { - // merge sub directories of current $directory into _resource_dir to speed up subsequent lookup - $dirs = array_merge($dirs, $_directory); - - return $dirs; + return $_directory; } // abort if we've reached root if (!preg_match('#[\\\/][^\\\/]+[\\\/]$#', $directory)) { break; } - // bubble up one level + // remember the directory to add it to _resource_dir in case we're successful + $_directory[ $directory ] = true; + // bubble up one level $directory = preg_replace('#[\\\/][^\\\/]+[\\\/]$#', DIRECTORY_SEPARATOR, $directory); } From c95d3f3a4d088dae2c62d713c5fb86bfc226dbed Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Tue, 24 Apr 2018 11:33:47 +0200 Subject: [PATCH 16/31] - fix compatibility for PHP version < 5.6 --- libs/Smarty.class.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index aba24441..0ce8fdea 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1042,10 +1042,16 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function _realpath($path, $realpath = null) { - static $nds = array('/' => '\\', '\\' => '/'); - static $sepDotsep = DIRECTORY_SEPARATOR . '.' . DIRECTORY_SEPARATOR; - static $sepDot = DIRECTORY_SEPARATOR . '.'; - static $sepSep = DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR; + static $nds = null; + static $sepDotsep = null; + static $sepDot = null; + static $sepSep =null; + if (!isset($nds)) { + $nds = array('/' => '\\', '\\' => '/'); + $sepDotsep = DIRECTORY_SEPARATOR . '.' . DIRECTORY_SEPARATOR; + $sepDot = DIRECTORY_SEPARATOR . '.'; + $sepSep = DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR; + } // normalize DIRECTORY_SEPARATOR $path = str_replace(array($nds[DIRECTORY_SEPARATOR], $sepDotsep), DIRECTORY_SEPARATOR, $path); if (strpos($path,$sepDot) === false && (($realpath === false && $path[0] === '.') || $realpath === null) && $path[0] !== '\\') { From 20c3f70379978153557cf63d05df4b21b477dfc2 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Tue, 24 Apr 2018 12:37:01 +0200 Subject: [PATCH 17/31] update .travis.yml --- .travis.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1dc83909..0378de05 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,20 +1,21 @@ language: php -sudo: true +sudo: false dist: trusty matrix: include: - php: 5.3 - dist: precise - php: 5.4 - php: 5.5 - php: 5.6 - php: 7.0 - php: 7.1 - php: 7.2 + - php: nightly + fast_finish: true services: - memcached @@ -25,14 +26,14 @@ before_script: - if [ ${TRAVIS_PHP_VERSION:0:3} <= "5.6" ]; then phpenv config-add travis.ini; fi - if [ ${TRAVIS_PHP_VERSION:0:3} >= "5.3" ]; then phpenv config-add error_reporting.ini; fi - if [[ $TRAVIS_PHP_VERSION = 7.* ]]; then composer require phpunit/phpunit 6.4.1; fi - - composer install - mysql -e "create database IF NOT EXISTS test;" -uroot before_install: - phpenv config-rm xdebug.ini || return 0 install: - - git clone --depth=50 --branch=master git://github.com/smarty-php/smarty-phpunit.git + - travis_retry composer install + - git clone --depth=50 --branch=master git://github.com/smarty-php/smarty-phpunit.git script: - cd smarty-phpunit From a57d514e8c2542714b5676cd2f2558cb84cc017c Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Tue, 24 Apr 2018 12:41:39 +0200 Subject: [PATCH 18/31] update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 0378de05..3c565e1b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ dist: trusty matrix: include: - php: 5.3 + dist: precise - php: 5.4 - php: 5.5 - php: 5.6 From 216ada91f3c72114164329bd33dea4a882adf776 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Tue, 24 Apr 2018 16:00:35 +0200 Subject: [PATCH 19/31] remove - php: nightly test --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3c565e1b..3cc39a58 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,6 @@ matrix: - php: 7.0 - php: 7.1 - php: 7.2 - - php: nightly fast_finish: true services: From bcedfd6b58bed4a7366336979ebaa5a240581531 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Tue, 24 Apr 2018 16:14:10 +0200 Subject: [PATCH 20/31] Release version 3.1.32 --- change_log.txt | 2 +- libs/Smarty.class.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/change_log.txt b/change_log.txt index a3ebcc36..5765a171 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,4 @@ -===== 3.1.32 - dev === +===== 3.1.32 ===== (24.04.2018) 24.04.2018 - bugfix possible Security Vulnerability in Smarty_Security class. diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 0ce8fdea..597fbbf0 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -21,13 +21,13 @@ * smarty-discussion-subscribe@googlegroups.com * * @link http://www.smarty.net/ - * @copyright 2017 New Digital Group, Inc. - * @copyright 2017 Uwe Tews + * @copyright 2018 New Digital Group, Inc. + * @copyright 2018 Uwe Tews * @author Monte Ohrt - * @author Uwe Tews + * @author Uwe Tews * @author Rodney Rehm * @package Smarty - * @version 3.1.32-dev + * @version 3.1.32 */ /** * set SMARTY_DIR to absolute path to Smarty library files. @@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.32-dev-46'; + const SMARTY_VERSION = '3.1.32'; /** * define variable scopes */ From e83bdc2ececdaa4c77ac7090c3a86c8b463c4d86 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Tue, 24 Apr 2018 16:51:39 +0200 Subject: [PATCH 21/31] Revert "remove - php: nightly test" This reverts commit 216ada91f3c72114164329bd33dea4a882adf776. --- .travis.yml | 2 +- libs/libs - Verknüpfung.lnk | Bin 0 -> 1027 bytes utilities/BuildExpectedFiles.php | 30 ++++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 libs/libs - Verknüpfung.lnk create mode 100644 utilities/BuildExpectedFiles.php diff --git a/.travis.yml b/.travis.yml index 3cc39a58..0378de05 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,13 +8,13 @@ dist: trusty matrix: include: - php: 5.3 - dist: precise - php: 5.4 - php: 5.5 - php: 5.6 - php: 7.0 - php: 7.1 - php: 7.2 + - php: nightly fast_finish: true services: diff --git a/libs/libs - Verknüpfung.lnk b/libs/libs - Verknüpfung.lnk new file mode 100644 index 0000000000000000000000000000000000000000..518311b55b88bf34fa09b08b98cd87ff9f30b696 GIT binary patch literal 1027 zcmeZaU|?VrVPXJ*10aHd!L6HtgF%3Sf#J8&s;T97E-|)O>Ktr1e;H1LB|-Wi>fvNQ zqX>h1zytpa3a_j(1s2`lV9+)&m@CPk?`#zVSA<}MFc^Y4hrM1U8!(h7<`$TlFfiCL za5Atkyx(`&Yeh0hMvsAkVcRQ^LWmMSFbyQ0u05uiA5!q$gUG8 z1<8O+n->6bnGnQLaB_J;F+(v!E<++i5km<>CD?U-P}g<%T$(Askdv8I%)np;cb{7+ zNE~FM_-c^*K&HZtV_;y2HIrq`VaQ}iVkl-{U=U$oVDM*PV32|O1Vn?v0Hni@fq_AS zfq?;JiiJ&63MeweGxJjN%ZnMDtzsZS9aCOj9s}`L48$pn40;R+5N!)0K;|$oFeK)b zKv@v#ff~QPji0CQl1DFvSf=woy^;Me?pOA6!RB`-Y_H^>P#`4V&&a^Q$-uB6mVtr6 zFgPIit-;<~&J3OI%YR%DUQ(Q<6qO7@Qfb7-CT39mE60 zn(uaRY7VBi9&02$88z`%eAP6h^11_lOxkfZ~M z*mVh<^g(8_fcPLCJPZsBE)0nbB@C$ynGE?1MGPqnc?_uxMGO$#d?1A&-HZ1tUCBLv znGwWKgt}!}RisDot() && 'php' == $file->getExtension()) { + $filename = $file->getBasename(); + $sysplugins[ $filename ] = true; + } +} +$plugins = array(); +$iterator = new DirectoryIterator(__DIR__ . '/../libs/plugins'); +foreach ($iterator as $file) { + if (!$file->isDot() && 'php' == $file->getExtension()) { + $filename = $file->getBasename(); + $plugins[ $filename ] = true; + } +} +$code = file_get_contents(__DIR__ . '/../libs/sysplugins/smarty_internal_testinstall.php'); +$expectedPlugins = '$expectedPlugins = ' . var_export($plugins, true); +$code = preg_replace('#\$expectedPlugins =[^;]+#', $expectedPlugins, $code); +$expectedSysplugins = '$expectedSysplugins = ' . var_export($sysplugins, true); +$code = preg_replace('#\$expectedSysplugins =[^;]+#', $expectedSysplugins, $code); +file_put_contents(__DIR__ . '/../libs/sysplugins/smarty_internal_testinstall.php', $code); + From ac9d4b587e5bf53381e21881820a9830765cb459 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Tue, 24 Apr 2018 16:53:33 +0200 Subject: [PATCH 22/31] Release version 3.1.32 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0378de05..3cc39a58 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,13 +8,13 @@ dist: trusty matrix: include: - php: 5.3 + dist: precise - php: 5.4 - php: 5.5 - php: 5.6 - php: 7.0 - php: 7.1 - php: 7.2 - - php: nightly fast_finish: true services: From f9ca3c63d1250bb56b2bda609dcc9dd81f0065f8 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Thu, 26 Apr 2018 13:02:51 +0200 Subject: [PATCH 23/31] - bugfix regarding Security Vulnerability did not solve the problem under Linux --- change_log.txt | 6 ++++- libs/Smarty.class.php | 21 +++++++----------- libs/sysplugins/smarty_security.php | 34 ++++++++++------------------- 3 files changed, 25 insertions(+), 36 deletions(-) diff --git a/change_log.txt b/change_log.txt index 5765a171..ffd6368f 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,8 @@ -===== 3.1.32 ===== (24.04.2018) +===== 3.1.33-dev-1 ===== +26.04.2018 + - bugfix regarding Security Vulnerability did not solve the problem under Linux. + +===== 3.1.32 ===== (24.04.2018) 24.04.2018 - bugfix possible Security Vulnerability in Smarty_Security class. diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 597fbbf0..8ae85206 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -27,7 +27,7 @@ * @author Uwe Tews * @author Rodney Rehm * @package Smarty - * @version 3.1.32 + * @version 3.1.33-dev */ /** * set SMARTY_DIR to absolute path to Smarty library files. @@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.32'; + const SMARTY_VERSION = '3.1.33-dev-1'; /** * define variable scopes */ @@ -835,7 +835,7 @@ class Smarty extends Smarty_Internal_TemplateBase $this->plugins_dir = (array)$this->plugins_dir; } foreach ($this->plugins_dir as $k => $v) { - $this->plugins_dir[ $k ] = $this->_realpath(rtrim($v, "/\\") . DIRECTORY_SEPARATOR, true); + $this->plugins_dir[ $k ] = $this->_realpath(rtrim($v, '/\\') . DIRECTORY_SEPARATOR, true); } $this->_cache[ 'plugin_files' ] = array(); $this->_pluginsDirNormalized = true; @@ -1043,20 +1043,15 @@ class Smarty extends Smarty_Internal_TemplateBase public function _realpath($path, $realpath = null) { static $nds = null; - static $sepDotsep = null; - static $sepDot = null; - static $sepSep =null; + static $sepDotSep = null; + static $sepSep =null; if (!isset($nds)) { $nds = array('/' => '\\', '\\' => '/'); - $sepDotsep = DIRECTORY_SEPARATOR . '.' . DIRECTORY_SEPARATOR; - $sepDot = DIRECTORY_SEPARATOR . '.'; + $sepDotSep = DIRECTORY_SEPARATOR . '.' . DIRECTORY_SEPARATOR; $sepSep = DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR; } // normalize DIRECTORY_SEPARATOR - $path = str_replace(array($nds[DIRECTORY_SEPARATOR], $sepDotsep), DIRECTORY_SEPARATOR, $path); - if (strpos($path,$sepDot) === false && (($realpath === false && $path[0] === '.') || $realpath === null) && $path[0] !== '\\') { - return $path; - } + $path = str_replace(array($nds[DIRECTORY_SEPARATOR], $sepDotSep), DIRECTORY_SEPARATOR, $path); preg_match('%^(?(?:[[:alpha:]]:[\\\\]|/|[\\\\]{2}[[:alpha:]]+|[[:print:]]{2,}:[/]{2}|[\\\\])?)(?(.*))$%u', $path, $parts); @@ -1069,7 +1064,7 @@ class Smarty extends Smarty_Internal_TemplateBase } } // remove noop 'DIRECTORY_SEPARATOR DIRECTORY_SEPARATOR' and 'DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR' patterns - $path = str_replace(array($sepDotsep,$sepSep), DIRECTORY_SEPARATOR, $path); + $path = str_replace(array($sepDotSep,$sepSep), DIRECTORY_SEPARATOR, $path); // resolve '..DIRECTORY_SEPARATOR' pattern, smallest first if (strpos($path, '..' . DIRECTORY_SEPARATOR) !== false && preg_match_all('#[\\\\/]([.][.][\\\\/])+#u', $path, $match) diff --git a/libs/sysplugins/smarty_security.php b/libs/sysplugins/smarty_security.php index 126f6fb4..9c7758f7 100644 --- a/libs/sysplugins/smarty_security.php +++ b/libs/sysplugins/smarty_security.php @@ -258,8 +258,6 @@ class Smarty_Security public function __construct($smarty) { $this->smarty = $smarty; - $this->smarty->_cache[ 'template_dir_new' ] = true; - $this->smarty->_cache[ 'config_dir_new' ] = true; } /** @@ -521,24 +519,23 @@ class Smarty_Security } $this->_include_path_status = $this->smarty->use_include_path; } - if ($isConfig !== true) { + $_dir = $this->smarty->getTemplateDir(); if ($this->_template_dir !== $_dir) { $this->_updateResourceDir($this->_template_dir, $_dir); $this->_template_dir = $_dir; } - } - if ($isConfig !== false) { + $_dir = $this->smarty->getConfigDir(); if ($this->_config_dir !== $_dir) { $this->_updateResourceDir($this->_config_dir, $_dir); $this->_config_dir = $_dir; } - } + if ($this->_secure_dir !== $this->secure_dir) { $this->secure_dir = (array)$this->secure_dir; foreach($this->secure_dir as $k => $d) { - $this->secure_dir[$k] = $this->smarty->_realpath($d.DIRECTORY_SEPARATOR,true); + $this->secure_dir[$k] = $this->smarty->_realpath($d. DIRECTORY_SEPARATOR,true); } $this->_updateResourceDir($this->_secure_dir, $this->secure_dir); $this->_secure_dir = $this->secure_dir; @@ -597,7 +594,7 @@ class Smarty_Security $this->_trusted_dir = $this->trusted_dir; foreach ((array) $this->trusted_dir as $directory) { - $directory = $this->smarty->_realpath($directory . DIRECTORY_SEPARATOR, true); + $directory = $this->smarty->_realpath($directory . '/', true); $this->_php_resource_dir[ $directory ] = true; } } @@ -616,7 +613,7 @@ class Smarty_Security */ private function _updateResourceDir($oldDir, $newDir) { foreach ($oldDir as $directory) { - $directory = $this->smarty->_realpath($directory, true); + // $directory = $this->smarty->_realpath($directory, true); $length = strlen($directory); foreach ($this->_resource_dir as $dir) { if (substr($dir, 0,$length) === $directory) { @@ -625,7 +622,7 @@ class Smarty_Security } } foreach ($newDir as $directory) { - $directory = $this->smarty->_realpath($directory, true); + // $directory = $this->smarty->_realpath($directory, true); $this->_resource_dir[ $directory ] = true; } } @@ -640,12 +637,7 @@ class Smarty_Security */ private function _checkDir($filepath, $dirs) { - $directory = dirname($filepath) . DIRECTORY_SEPARATOR; - if (isset($dirs[ $directory ])) { - return false; - } - $filepath = $this->smarty->_realpath($filepath, true); - $directory = dirname($filepath) . DIRECTORY_SEPARATOR; + $directory = dirname($this->smarty->_realpath($filepath, true)) . DIRECTORY_SEPARATOR; $_directory = array(); while (true) { // test if the directory is trusted @@ -653,17 +645,15 @@ class Smarty_Security return $_directory; } // abort if we've reached root - if (!preg_match('#[\\\/][^\\\/]+[\\\/]$#', $directory)) { - break; + if (!preg_match('#[\\\\/][^\\\\/]+[\\\\/]$#', $directory)) { + // give up + throw new SmartyException(sprintf('Smarty Security: not trusted file path \'%s\' ',$filepath)); } // remember the directory to add it to _resource_dir in case we're successful $_directory[ $directory ] = true; // bubble up one level - $directory = preg_replace('#[\\\/][^\\\/]+[\\\/]$#', DIRECTORY_SEPARATOR, $directory); + $directory = preg_replace('#[\\\\/][^\\\\/]+[\\\\/]$#', '/', $directory); } - - // give up - throw new SmartyException("directory '{$filepath}' not allowed by security setting"); } /** From 2e081a51b1effddb23f87952959139ac62654d50 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Thu, 26 Apr 2018 18:06:45 +0200 Subject: [PATCH 24/31] - bugfix regarding Security Vulnerability did not solve the problem under Linux --- libs/Smarty.class.php | 44 ++++++++--------------------- libs/sysplugins/smarty_security.php | 2 +- 2 files changed, 13 insertions(+), 33 deletions(-) diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 8ae85206..bdeffb16 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1042,16 +1042,9 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function _realpath($path, $realpath = null) { - static $nds = null; - static $sepDotSep = null; - static $sepSep =null; - if (!isset($nds)) { - $nds = array('/' => '\\', '\\' => '/'); - $sepDotSep = DIRECTORY_SEPARATOR . '.' . DIRECTORY_SEPARATOR; - $sepSep = DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR; - } + $nds = array('/' => '\\', '\\' => '/'); // normalize DIRECTORY_SEPARATOR - $path = str_replace(array($nds[DIRECTORY_SEPARATOR], $sepDotSep), DIRECTORY_SEPARATOR, $path); + $path = str_replace(array($nds[DIRECTORY_SEPARATOR], DIRECTORY_SEPARATOR . '.' . DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR, $path); preg_match('%^(?(?:[[:alpha:]]:[\\\\]|/|[\\\\]{2}[[:alpha:]]+|[[:print:]]{2,}:[/]{2}|[\\\\])?)(?(.*))$%u', $path, $parts); @@ -1063,24 +1056,11 @@ class Smarty extends Smarty_Internal_TemplateBase $path = getcwd() . DIRECTORY_SEPARATOR . $path; } } - // remove noop 'DIRECTORY_SEPARATOR DIRECTORY_SEPARATOR' and 'DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR' patterns - $path = str_replace(array($sepDotSep,$sepSep), DIRECTORY_SEPARATOR, $path); - // resolve '..DIRECTORY_SEPARATOR' pattern, smallest first - if (strpos($path, '..' . DIRECTORY_SEPARATOR) !== false && - preg_match_all('#[\\\\/]([.][.][\\\\/])+#u', $path, $match) - ) { - $counts = array(); - foreach ($match[ 0 ] as $m) { - $counts[] = (int)((strlen($m) - 1) / 3); - } - sort($counts); - foreach ($counts as $count) { - $path = preg_replace('#([\\\\/]+[^\\\\/]+){' . $count . - '}[\\\\/]+([.][.][\\\\/]+){' . $count . '}#u', - DIRECTORY_SEPARATOR, - $path); - } - } + do { + $path = preg_replace( + array('#[\\\\/]{2}#', '#[\\\\/][.][\\\\/]#', '#[\\\\/]([^\\\\/.]+)[\\\\/][.][.][\\\\/]#'), + DIRECTORY_SEPARATOR, $path, -1, $count); + } while($count > 0); return $realpath !== false ? $parts[ 'root' ] . $path : str_ireplace(getcwd(), '.', $parts[ 'root' ] . $path); } @@ -1284,13 +1264,13 @@ class Smarty extends Smarty_Internal_TemplateBase if (isset($this->accessMap[ $name ])) { $method = 'get' . $this->accessMap[ $name ]; return $this->{$method}(); - } else if (isset($this->_cache[ $name ])) { + } else {if (isset($this->_cache[ $name ])) { return $this->_cache[ $name ]; - } else if (in_array($name, $this->obsoleteProperties)) { + } else {if (in_array($name, $this->obsoleteProperties)) { return null; } else { trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE); - } + }}} return null; } @@ -1309,7 +1289,7 @@ class Smarty extends Smarty_Internal_TemplateBase if (isset($this->accessMap[ $name ])) { $method = 'set' . $this->accessMap[ $name ]; $this->{$method}($value); - } else if (in_array($name, $this->obsoleteProperties)) { + } else {if (in_array($name, $this->obsoleteProperties)) { return; } else { if (is_object($value) && method_exists($value, $name)) { @@ -1317,7 +1297,7 @@ class Smarty extends Smarty_Internal_TemplateBase } else { trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE); } - } + }} } /** diff --git a/libs/sysplugins/smarty_security.php b/libs/sysplugins/smarty_security.php index 9c7758f7..2706fad2 100644 --- a/libs/sysplugins/smarty_security.php +++ b/libs/sysplugins/smarty_security.php @@ -652,7 +652,7 @@ class Smarty_Security // remember the directory to add it to _resource_dir in case we're successful $_directory[ $directory ] = true; // bubble up one level - $directory = preg_replace('#[\\\\/][^\\\\/]+[\\\\/]$#', '/', $directory); + $directory = preg_replace('#[\\\\/][^\\\\/]+[\\\\/]$#', DIRECTORY_SEPARATOR, $directory); } } From c9dbe1d08c081912d02bd851d1d1b6388f6133d1 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Thu, 26 Apr 2018 21:38:08 +0200 Subject: [PATCH 25/31] - bugfix regarding Security Vulnerability did not solve the problem under Linux --- libs/sysplugins/smarty_security.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/sysplugins/smarty_security.php b/libs/sysplugins/smarty_security.php index 2706fad2..5378c390 100644 --- a/libs/sysplugins/smarty_security.php +++ b/libs/sysplugins/smarty_security.php @@ -639,7 +639,8 @@ class Smarty_Security { $directory = dirname($this->smarty->_realpath($filepath, true)) . DIRECTORY_SEPARATOR; $_directory = array(); - while (true) { + if (!preg_match('#[\\\\/][.][.][\\\\/]#',$directory)) { + while (true) { // test if the directory is trusted if (isset($dirs[ $directory ])) { return $_directory; @@ -647,13 +648,16 @@ class Smarty_Security // abort if we've reached root if (!preg_match('#[\\\\/][^\\\\/]+[\\\\/]$#', $directory)) { // give up - throw new SmartyException(sprintf('Smarty Security: not trusted file path \'%s\' ',$filepath)); + break; } // remember the directory to add it to _resource_dir in case we're successful $_directory[ $directory ] = true; // bubble up one level $directory = preg_replace('#[\\\\/][^\\\\/]+[\\\\/]$#', DIRECTORY_SEPARATOR, $directory); + } } + // give up + throw new SmartyException(sprintf('Smarty Security: not trusted file path \'%s\' ',$filepath)); } /** From cb59fc5537c18a3fc5b835c26b3a35741bd60368 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Sat, 28 Apr 2018 05:32:02 +0200 Subject: [PATCH 26/31] Delete unwanted file --- libs/libs - Verknüpfung.lnk | Bin 1027 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 libs/libs - Verknüpfung.lnk diff --git a/libs/libs - Verknüpfung.lnk b/libs/libs - Verknüpfung.lnk deleted file mode 100644 index 518311b55b88bf34fa09b08b98cd87ff9f30b696..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1027 zcmeZaU|?VrVPXJ*10aHd!L6HtgF%3Sf#J8&s;T97E-|)O>Ktr1e;H1LB|-Wi>fvNQ zqX>h1zytpa3a_j(1s2`lV9+)&m@CPk?`#zVSA<}MFc^Y4hrM1U8!(h7<`$TlFfiCL za5Atkyx(`&Yeh0hMvsAkVcRQ^LWmMSFbyQ0u05uiA5!q$gUG8 z1<8O+n->6bnGnQLaB_J;F+(v!E<++i5km<>CD?U-P}g<%T$(Askdv8I%)np;cb{7+ zNE~FM_-c^*K&HZtV_;y2HIrq`VaQ}iVkl-{U=U$oVDM*PV32|O1Vn?v0Hni@fq_AS zfq?;JiiJ&63MeweGxJjN%ZnMDtzsZS9aCOj9s}`L48$pn40;R+5N!)0K;|$oFeK)b zKv@v#ff~QPji0CQl1DFvSf=woy^;Me?pOA6!RB`-Y_H^>P#`4V&&a^Q$-uB6mVtr6 zFgPIit-;<~&J3OI%YR%DUQ(Q<6qO7@Qfb7-CT39mE60 zn(uaRY7VBi9&02$88z`%eAP6h^11_lOxkfZ~M z*mVh<^g(8_fcPLCJPZsBE)0nbB@C$ynGE?1MGPqnc?_uxMGO$#d?1A&-HZ1tUCBLv znGwWKgt}!}R Date: Thu, 17 May 2018 04:40:58 +0200 Subject: [PATCH 27/31] - bugfix plugins may not be loaded when setMergeCompiledIncludes is true https://github.com/smarty-php/smarty/issues/435 --- change_log.txt | 5 ++++- libs/Smarty.class.php | 6 +++--- libs/sysplugins/smarty_internal_runtime_codeframe.php | 4 ---- libs/sysplugins/smarty_internal_templatecompilerbase.php | 3 +++ 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/change_log.txt b/change_log.txt index ffd6368f..5a81e84c 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ -===== 3.1.33-dev-1 ===== +===== 3.1.33-dev-2 ===== +17.05.2018 + - bugfix plugins may not be loaded when setMergeCompiledIncludes is true https://github.com/smarty-php/smarty/issues/435 + 26.04.2018 - bugfix regarding Security Vulnerability did not solve the problem under Linux. diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index bdeffb16..f9737b28 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.33-dev-1'; + const SMARTY_VERSION = '3.1.33-dev-2'; /** * define variable scopes */ @@ -1011,7 +1011,7 @@ class Smarty extends Smarty_Internal_TemplateBase Smarty_Internal_Template $template = null) { $template_name = (strpos($template_name, ':') === false) ? "{$this->default_resource_type}:{$template_name}" : - $template_name; + $template_name; $cache_id = $cache_id === null ? $this->cache_id : $cache_id; $compile_id = $compile_id === null ? $this->compile_id : $compile_id; $caching = (int)($caching === null ? $this->caching : $caching); @@ -1044,7 +1044,7 @@ class Smarty extends Smarty_Internal_TemplateBase { $nds = array('/' => '\\', '\\' => '/'); // normalize DIRECTORY_SEPARATOR - $path = str_replace(array($nds[DIRECTORY_SEPARATOR], DIRECTORY_SEPARATOR . '.' . DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR, $path); + //$path = str_replace(array($nds[DIRECTORY_SEPARATOR], DIRECTORY_SEPARATOR . '.' . DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR, $path); preg_match('%^(?(?:[[:alpha:]]:[\\\\]|/|[\\\\]{2}[[:alpha:]]+|[[:print:]]{2,}:[/]{2}|[\\\\])?)(?(.*))$%u', $path, $parts); diff --git a/libs/sysplugins/smarty_internal_runtime_codeframe.php b/libs/sysplugins/smarty_internal_runtime_codeframe.php index f792496f..80a50eb8 100644 --- a/libs/sysplugins/smarty_internal_runtime_codeframe.php +++ b/libs/sysplugins/smarty_internal_runtime_codeframe.php @@ -58,10 +58,6 @@ class Smarty_Internal_Runtime_CodeFrame var_export($_template->smarty->ext->_tplFunction->getTplFunction($_template), true) . ");\n"; } - // include code for required plugins - if (!$cache && isset($compiler)) { - $output .= $compiler->compileRequiredPlugins(); - } $output .= "?>"; $output .= $content; $output .= ""; diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index 0d7284a0..be3647bd 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -421,6 +421,9 @@ abstract class Smarty_Internal_TemplateCompilerBase $_content = $this->template->source->getContent(); } $_compiled_code = $this->postFilter($this->doCompile($this->preFilter($_content), true)); + if (!empty($this->required_plugins[ 'compiled' ]) || !empty($this->required_plugins[ 'nocache' ])) { + $_compiled_code = 'compileRequiredPlugins() . "?>\n" . $_compiled_code; + } } catch (Exception $e) { if ($this->smarty->debugging) { From 514d99beaaad028fe9bf09b3188ab2a281d0f3f8 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Thu, 17 May 2018 06:27:35 +0200 Subject: [PATCH 28/31] - improvement do not compute total property in {foreach} if not needed https://github.com/smarty-php/smarty/issues/443 --- change_log.txt | 3 ++- libs/Smarty.class.php | 2 +- libs/sysplugins/smarty_internal_runtime_foreach.php | 7 +++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/change_log.txt b/change_log.txt index 5a81e84c..3d3f2e34 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,5 +1,6 @@ -===== 3.1.33-dev-2 ===== +===== 3.1.33-dev-3 ===== 17.05.2018 + - improvement do not compute total property in {foreach} if not needed https://github.com/smarty-php/smarty/issues/443 - bugfix plugins may not be loaded when setMergeCompiledIncludes is true https://github.com/smarty-php/smarty/issues/435 26.04.2018 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index f9737b28..2116f74d 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.33-dev-2'; + const SMARTY_VERSION = '3.1.33-dev-3'; /** * define variable scopes */ diff --git a/libs/sysplugins/smarty_internal_runtime_foreach.php b/libs/sysplugins/smarty_internal_runtime_foreach.php index 8b60768b..4fa29d5b 100644 --- a/libs/sysplugins/smarty_internal_runtime_foreach.php +++ b/libs/sysplugins/smarty_internal_runtime_foreach.php @@ -37,17 +37,20 @@ class Smarty_Internal_Runtime_Foreach public function init(Smarty_Internal_Template $tpl, $from, $item, $needTotal = false, $key = null, $name = null, $properties = array()) { + $needTotal = $needTotal || isset($properties[ 'total' ]); $saveVars = array(); $total = null; if (!is_array($from)) { if (is_object($from)) { - $total = $this->count($from); + if ($needTotal) { + $total = $this->count($from); + } } else { settype($from, 'array'); } } if (!isset($total)) { - $total = empty($from) ? 0 : (($needTotal || isset($properties[ 'total' ])) ? count($from) : 1); + $total = empty($from) ? 0 : ($needTotal ? count($from) : 1); } if (isset($tpl->tpl_vars[ $item ])) { $saveVars[ 'item' ] = array($item, From e2aec4d0112ea60b2af36f0c3f497a7f9bf63961 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Thu, 17 May 2018 08:12:26 +0200 Subject: [PATCH 29/31] Fix annotation https://github.com/smarty-php/smarty/issues/441 --- libs/sysplugins/smarty_internal_templatebase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/sysplugins/smarty_internal_templatebase.php b/libs/sysplugins/smarty_internal_templatebase.php index 6b959404..17474fe2 100644 --- a/libs/sysplugins/smarty_internal_templatebase.php +++ b/libs/sysplugins/smarty_internal_templatebase.php @@ -20,7 +20,7 @@ * They are located in a corresponding Smarty_Internal_Method_xxxx class * * @method Smarty_Internal_TemplateBase addAutoloadFilters(mixed $filters, string $type = null) - * @method Smarty_Internal_TemplateBase addDefaultModifier(mixed $modifiers) + * @method Smarty_Internal_TemplateBase addDefaultModifiers(mixed $modifiers) * @method Smarty_Internal_TemplateBase addLiterals(mixed $literals) * @method Smarty_Internal_TemplateBase createData(Smarty_Internal_Data $parent = null, string $name = null) * @method array getAutoloadFilters(string $type = null) From 87ec44e9f8010fe519cd8df39f9cbf8c6c5d69c4 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Thu, 17 May 2018 13:50:14 +0200 Subject: [PATCH 30/31] - bugfix Smarty::compileAllTemplates ignores `$extension` parameter https://github.com/smarty-php/smarty/issues/437 https://github.com/smarty-php/smarty/pull/438 --- change_log.txt | 4 +++- libs/Smarty.class.php | 2 +- .../sysplugins/smarty_internal_method_compilealltemplates.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/change_log.txt b/change_log.txt index 3d3f2e34..c180868d 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,5 +1,7 @@ -===== 3.1.33-dev-3 ===== +===== 3.1.33-dev-4 ===== 17.05.2018 + - Smarty::compileAllTemplates ignores `$extension` parameter https://github.com/smarty-php/smarty/issues/437 + https://github.com/smarty-php/smarty/pull/438 - improvement do not compute total property in {foreach} if not needed https://github.com/smarty-php/smarty/issues/443 - bugfix plugins may not be loaded when setMergeCompiledIncludes is true https://github.com/smarty-php/smarty/issues/435 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 2116f74d..ad52cbc6 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.33-dev-3'; + const SMARTY_VERSION = '3.1.33-dev-4'; /** * define variable scopes */ diff --git a/libs/sysplugins/smarty_internal_method_compilealltemplates.php b/libs/sysplugins/smarty_internal_method_compilealltemplates.php index 64912599..6e7c40cd 100644 --- a/libs/sysplugins/smarty_internal_method_compilealltemplates.php +++ b/libs/sysplugins/smarty_internal_method_compilealltemplates.php @@ -75,7 +75,7 @@ class Smarty_Internal_Method_CompileAllTemplates if (substr(basename($_fileinfo->getPathname()), 0, 1) === '.' || strpos($_file, '.svn') !== false) { continue; } - if (!substr_compare($_file, $extension, -strlen($extension)) === 0) { + if (substr_compare($_file, $extension, -strlen($extension)) !== 0) { continue; } if ($_fileinfo->getPath() !== substr($_dir, 0, -1)) { From cc4d8fa1a07e18f00951a921041e37c87015dcb2 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Thu, 17 May 2018 16:04:48 +0200 Subject: [PATCH 31/31] - bugfix strip-block produces different output in Smarty v3.1.32 https://github.com/smarty-php/smarty/issues/436 --- change_log.txt | 3 ++- libs/Smarty.class.php | 2 +- .../smarty_internal_templatecompilerbase.php | 26 +++++++++---------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/change_log.txt b/change_log.txt index c180868d..982a7e8e 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,6 +1,7 @@ ===== 3.1.33-dev-4 ===== 17.05.2018 - - Smarty::compileAllTemplates ignores `$extension` parameter https://github.com/smarty-php/smarty/issues/437 + - bugfix strip-block produces different output in Smarty v3.1.32 https://github.com/smarty-php/smarty/issues/436 + - bugfix Smarty::compileAllTemplates ignores `$extension` parameter https://github.com/smarty-php/smarty/issues/437 https://github.com/smarty-php/smarty/pull/438 - improvement do not compute total property in {foreach} if not needed https://github.com/smarty-php/smarty/issues/443 - bugfix plugins may not be loaded when setMergeCompiledIncludes is true https://github.com/smarty-php/smarty/issues/435 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index ad52cbc6..4d307547 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.33-dev-4'; + const SMARTY_VERSION = '3.1.33-dev-5'; /** * define variable scopes */ diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index be3647bd..f414e1d0 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -618,7 +618,7 @@ abstract class Smarty_Internal_TemplateCompilerBase */ public function processText($text) { - if ((string)$text !== '') { + if ((string) $text != '') { $store = array(); $_store = 0; if ($this->parser->strip) { @@ -626,39 +626,37 @@ abstract class Smarty_Internal_TemplateCompilerBase // capture html elements not to be messed with $_offset = 0; if (preg_match_all('#(]*>.*?]*>)|(]*>.*?]*>)|(]*>.*?]*>)#is', - $text, - $matches, - PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { + $text, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { foreach ($matches as $match) { $store[] = $match[ 0 ][ 0 ]; $_length = strlen($match[ 0 ][ 0 ]); $replace = '@!@SMARTY:' . $_store . ':SMARTY@!@'; $text = substr_replace($text, $replace, $match[ 0 ][ 1 ] - $_offset, $_length); + $_offset += $_length - strlen($replace); - ++$_store; + $_store ++; } } $expressions = array(// replace multiple spaces between tags by a single space - '#(:SMARTY@!@|>)[\040\011]+(?=@!@SMARTY:|<)#s' => '\1 \2', + '#(:SMARTY@!@|>)[\040\011]+(?=@!@SMARTY:|<)#s' => '\1 \2', // remove newline between tags - '#(:SMARTY@!@|>)[\040\011]*[\n]\s*(?=@!@SMARTY:|<)#s' => '\1\2', + '#(:SMARTY@!@|>)[\040\011]*[\n]\s*(?=@!@SMARTY:|<)#s' => '\1\2', // remove multiple spaces between attributes (but not in attribute values!) '#(([a-z0-9]\s*=\s*("[^"]*?")|(\'[^\']*?\'))|<[a-z0-9_]+)\s+([a-z/>])#is' => '\1 \5', - '#>[\040\011]+$#Ss' => '> ', - '#>[\040\011]*[\n]\s*$#Ss' => '>', - $this->stripRegEx => '',); + '#>[\040\011]+$#Ss' => '> ', '#>[\040\011]*[\n]\s*$#Ss' => '>', + $this->stripRegEx => '',); + $text = preg_replace(array_keys($expressions), array_values($expressions), $text); $_offset = 0; - if (preg_match_all('#@!@SMARTY:([0-9]+):SMARTY@!@#is', - $text, - $matches, + if (preg_match_all('#@!@SMARTY:([0-9]+):SMARTY@!@#is', $text, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { foreach ($matches as $match) { $_length = strlen($match[ 0 ][ 0 ]); $replace = $store[ $match[ 1 ][ 0 ] ]; $text = substr_replace($text, $replace, $match[ 0 ][ 1 ] + $_offset, $_length); + $_offset += strlen($replace) - $_length; - ++$_store; + $_store ++; } } } else {