mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
- code fixes
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
27.12.2015
|
27.12.2015
|
||||||
- improve inheritance code
|
- improve inheritance code
|
||||||
- update external methods
|
- update external methods
|
||||||
|
- code fixes
|
||||||
|
|
||||||
25.12.2015
|
25.12.2015
|
||||||
- compile {block} tag code and its processing into classes
|
- compile {block} tag code and its processing into classes
|
||||||
|
@@ -325,8 +325,8 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase
|
|||||||
$compiler->template->cache_id, $c_id, $_caching);
|
$compiler->template->cache_id, $c_id, $_caching);
|
||||||
if (!($tpl->source->handler->uncompiled) && $tpl->source->exists) {
|
if (!($tpl->source->handler->uncompiled) && $tpl->source->exists) {
|
||||||
$compiler->parent_compiler->mergedSubTemplatesData[$hashResourceName][$t_hash]['uid'] = $tpl->source->uid;
|
$compiler->parent_compiler->mergedSubTemplatesData[$hashResourceName][$t_hash]['uid'] = $tpl->source->uid;
|
||||||
if (isset($compiler->template->_inheritance)) {
|
if (isset($compiler->template->ext->_inheritance)) {
|
||||||
$tpl->_inheritance = clone $compiler->template->_inheritance;
|
$tpl->ext->_inheritance = clone $compiler->template->ext->_inheritance;
|
||||||
}
|
}
|
||||||
$tpl->compiled = new Smarty_Template_Compiled();
|
$tpl->compiled = new Smarty_Template_Compiled();
|
||||||
$tpl->compiled->nocache_hash = $compiler->parent_compiler->template->compiled->nocache_hash;
|
$tpl->compiled->nocache_hash = $compiler->parent_compiler->template->compiled->nocache_hash;
|
||||||
|
@@ -90,7 +90,7 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase
|
|||||||
if (isset($compiler->smarty->security_policy)) {
|
if (isset($compiler->smarty->security_policy)) {
|
||||||
$_dir = $compiler->smarty->security_policy->trusted_dir;
|
$_dir = $compiler->smarty->security_policy->trusted_dir;
|
||||||
} else {
|
} else {
|
||||||
$_dir = $compiler->smarty->trusted_dir;
|
$_dir = $compiler->smarty instanceof SmartyBC ? $compiler->smarty->trusted_dir : null;
|
||||||
}
|
}
|
||||||
if (!empty($_dir)) {
|
if (!empty($_dir)) {
|
||||||
foreach ((array) $_dir as $_script_dir) {
|
foreach ((array) $_dir as $_script_dir) {
|
||||||
|
@@ -175,7 +175,7 @@ class Smarty_Internal_Compile_Private_ForeachSection extends Smarty_Internal_Com
|
|||||||
// run pre filter if required
|
// run pre filter if required
|
||||||
if ((isset($nextCompiler->smarty->autoload_filters['pre']) ||
|
if ((isset($nextCompiler->smarty->autoload_filters['pre']) ||
|
||||||
isset($nextCompiler->smarty->registered_filters['pre']))) {
|
isset($nextCompiler->smarty->registered_filters['pre']))) {
|
||||||
$_content = $nextCompiler->smarty->ext->_filter_Handler->runFilter('pre', $_content, $nextCompiler->template);
|
$_content = $nextCompiler->smarty->ext->_filterHandler->runFilter('pre', $_content, $nextCompiler->template);
|
||||||
}
|
}
|
||||||
$this->matchProperty($_content);
|
$this->matchProperty($_content);
|
||||||
}
|
}
|
||||||
|
@@ -46,7 +46,7 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase
|
|||||||
$output = addcslashes($_attr['code'], "'\\");
|
$output = addcslashes($_attr['code'], "'\\");
|
||||||
$compiler->parser->current_buffer->append_subtree($compiler->parser, new Smarty_Internal_ParseTree_Tag($compiler->parser, $compiler->processNocacheCode("<?php echo '" .
|
$compiler->parser->current_buffer->append_subtree($compiler->parser, new Smarty_Internal_ParseTree_Tag($compiler->parser, $compiler->processNocacheCode("<?php echo '" .
|
||||||
$output .
|
$output .
|
||||||
"';?>", $compiler, true)));
|
"';?>", true)));
|
||||||
$compiler->template->compiled->has_nocache_code = $save;
|
$compiler->template->compiled->has_nocache_code = $save;
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,7 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase
|
|||||||
$output = addcslashes($_attr['code'], "'\\");
|
$output = addcslashes($_attr['code'], "'\\");
|
||||||
$compiler->parser->current_buffer->append_subtree($compiler->parser, new Smarty_Internal_ParseTree_Tag($compiler->parser, $compiler->processNocacheCode("<?php echo '" .
|
$compiler->parser->current_buffer->append_subtree($compiler->parser, new Smarty_Internal_ParseTree_Tag($compiler->parser, $compiler->processNocacheCode("<?php echo '" .
|
||||||
$output .
|
$output .
|
||||||
"';?>", $compiler, true)));
|
"';?>", true)));
|
||||||
$compiler->template->compiled->has_nocache_code = $save;
|
$compiler->template->compiled->has_nocache_code = $save;
|
||||||
return '';
|
return '';
|
||||||
} elseif ($compiler->php_handling == Smarty::PHP_ALLOW) {
|
} elseif ($compiler->php_handling == Smarty::PHP_ALLOW) {
|
||||||
|
@@ -33,7 +33,7 @@ class Smarty_Internal_Method_AddDefaultModifiers
|
|||||||
{
|
{
|
||||||
$smarty = isset($obj->smarty) ? $obj->smarty : $obj;
|
$smarty = isset($obj->smarty) ? $obj->smarty : $obj;
|
||||||
if (is_array($modifiers)) {
|
if (is_array($modifiers)) {
|
||||||
$this->default_modifiers = array_merge($smarty->default_modifiers, $modifiers);
|
$smarty->default_modifiers = array_merge($smarty->default_modifiers, $modifiers);
|
||||||
} else {
|
} else {
|
||||||
$smarty->default_modifiers[] = $modifiers;
|
$smarty->default_modifiers[] = $modifiers;
|
||||||
}
|
}
|
||||||
|
@@ -221,7 +221,6 @@ class Smarty_Template_Compiled extends Smarty_Template_Resource_Base
|
|||||||
{
|
{
|
||||||
$_template->source->compileds = array();
|
$_template->source->compileds = array();
|
||||||
$this->file_dependency = array();
|
$this->file_dependency = array();
|
||||||
$this->tpl_function = array();
|
|
||||||
$this->includes = array();
|
$this->includes = array();
|
||||||
$this->nocache_hash = null;
|
$this->nocache_hash = null;
|
||||||
$this->unifunc = null;
|
$this->unifunc = null;
|
||||||
|
Reference in New Issue
Block a user