mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 18:04:26 +02:00
Fixed bug in {include} variable assignment and removed some unused/unrequired code
This commit is contained in:
@@ -126,13 +126,13 @@ class Data
|
|||||||
break;
|
break;
|
||||||
case self::SCOPE_LOCAL:
|
case self::SCOPE_LOCAL:
|
||||||
default:
|
default:
|
||||||
if ($this->hasVariable($tpl_var)) {
|
if (isset($this->tpl_vars[$tpl_var])) {
|
||||||
$this->getVariable($tpl_var)->setValue($value);
|
$this->tpl_vars[$tpl_var]->setValue($value);
|
||||||
if ($nocache) {
|
if ($nocache) {
|
||||||
$this->getVariable($tpl_var)->setNocache(true);
|
$this->tpl_vars[$tpl_var]->setNocache(true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->tpl_vars[ $tpl_var ] = new Variable($value, $nocache);
|
$this->tpl_vars[$tpl_var] = new Variable($value, $nocache);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -531,12 +531,6 @@ class Smarty extends \Smarty\TemplateBase
|
|||||||
*/
|
*/
|
||||||
private $BCPluginsAdapter;
|
private $BCPluginsAdapter;
|
||||||
|
|
||||||
/**
|
|
||||||
* Cache of templates created
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
private $templates;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize new Smarty object
|
* Initialize new Smarty object
|
||||||
*/
|
*/
|
||||||
@@ -1000,12 +994,6 @@ class Smarty extends \Smarty\TemplateBase
|
|||||||
}
|
}
|
||||||
$_templateId = $this->generateUniqueTemplateId($template_name, $cache_id, $compile_id, $caching, $baseFilePath);
|
$_templateId = $this->generateUniqueTemplateId($template_name, $cache_id, $compile_id, $caching, $baseFilePath);
|
||||||
|
|
||||||
// if (true || !isset($this->templates[$_templateId])) {
|
|
||||||
// $this->templates[$_templateId] = new Template($template_name, $this, null, $cache_id, $compile_id, $caching);
|
|
||||||
// $this->templates[$_templateId]->templateId = $_templateId;
|
|
||||||
// }
|
|
||||||
// $tpl = $this->templates[$_templateId];
|
|
||||||
|
|
||||||
$tpl = new Template($template_name, $this, $parent ?: $this, $cache_id, $compile_id, $caching);
|
$tpl = new Template($template_name, $this, $parent ?: $this, $cache_id, $compile_id, $caching);
|
||||||
$tpl->templateId = $_templateId;
|
$tpl->templateId = $_templateId;
|
||||||
|
|
||||||
|
@@ -268,10 +268,6 @@ class Template extends TemplateBase {
|
|||||||
$tpl->setDefaultScope($scope);
|
$tpl->setDefaultScope($scope);
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy variables
|
|
||||||
$tpl->tpl_vars = $this->tpl_vars;
|
|
||||||
$tpl->config_vars = $this->config_vars;
|
|
||||||
|
|
||||||
// recursive call ?
|
// recursive call ?
|
||||||
if ($tpl->getTemplateId() !== $this->getTemplateId()) {
|
if ($tpl->getTemplateId() !== $this->getTemplateId()) {
|
||||||
|
|
||||||
|
@@ -120,7 +120,7 @@ class CompileWhileTest extends PHPUnit_Smarty
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Data provider für testNocache
|
* Data provider for testNocache
|
||||||
*/
|
*/
|
||||||
public function dataTestNocache()
|
public function dataTestNocache()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user