mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
- bugfix make sure that function properties get saved only in compiled files containing the fuction definition {forum topic 25452}
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
===== 3.1.22-dev ===== (xx.xx.2015)
|
===== 3.1.22-dev ===== (xx.xx.2015)
|
||||||
|
20.03.2015
|
||||||
|
- bugfix make sure that function properties get saved only in compiled files containing the fuction definition {forum topic 25452}
|
||||||
|
|
||||||
16.03.2015
|
16.03.2015
|
||||||
- bugfix problems with {function}{/function} and {call} tags in different subtemplate cache files {forum topic 25452}
|
- bugfix problems with {function}{/function} and {call} tags in different subtemplate cache files {forum topic 25452}
|
||||||
- bugfix Smarty_Security->allow_constants=false; did not disallow direct usage of defined constants like {SMARTY_DIR} {forum topic 25457}
|
- bugfix Smarty_Security->allow_constants=false; did not disallow direct usage of defined constants like {SMARTY_DIR} {forum topic 25457}
|
||||||
|
@@ -111,7 +111,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
/**
|
/**
|
||||||
* smarty version
|
* smarty version
|
||||||
*/
|
*/
|
||||||
const SMARTY_VERSION = '3.1.22-dev/14';
|
const SMARTY_VERSION = '3.1.22-dev/11';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* define variable scopes
|
* define variable scopes
|
||||||
|
@@ -32,12 +32,19 @@ class Smarty_Internal_Extension_CodeFrame
|
|||||||
if (!isset($_template->properties['unifunc'])) {
|
if (!isset($_template->properties['unifunc'])) {
|
||||||
$_template->properties['unifunc'] = 'content_' . str_replace(array('.', ','), '_', uniqid('', true));
|
$_template->properties['unifunc'] = 'content_' . str_replace(array('.', ','), '_', uniqid('', true));
|
||||||
}
|
}
|
||||||
|
$properties = $_template->properties;
|
||||||
|
if (!$cache) {
|
||||||
|
unset($properties['tpl_function']);
|
||||||
|
if (!empty($_template->compiler->templateProperties)) {
|
||||||
|
$properties['tpl_function'] = $_template->compiler->templateProperties['tpl_function'];
|
||||||
|
}
|
||||||
|
}
|
||||||
$output = "<?php\n";
|
$output = "<?php\n";
|
||||||
$output .= "/*%%SmartyHeaderCode:{$_template->properties['nocache_hash']}%%*/\n";
|
$output .= "/*%%SmartyHeaderCode:{$_template->properties['nocache_hash']}%%*/\n";
|
||||||
if ($_template->smarty->direct_access_security) {
|
if ($_template->smarty->direct_access_security) {
|
||||||
$output .= "if(!defined('SMARTY_DIR')) exit('no direct access allowed');\n";
|
$output .= "if(!defined('SMARTY_DIR')) exit('no direct access allowed');\n";
|
||||||
}
|
}
|
||||||
$output .= "\$_valid = \$_smarty_tpl->decodeProperties(" . var_export($_template->properties, true) . ',' . ($cache ? 'true' : 'false') . ");\n";
|
$output .= "\$_valid = \$_smarty_tpl->decodeProperties(" . var_export($properties, true) . ',' . ($cache ? 'true' : 'false') . ");\n";
|
||||||
$output .= "/*/%%SmartyHeaderCode%%*/\n";
|
$output .= "/*/%%SmartyHeaderCode%%*/\n";
|
||||||
$output .= "if (\$_valid && !is_callable('{$_template->properties['unifunc']}')) {\n";
|
$output .= "if (\$_valid && !is_callable('{$_template->properties['unifunc']}')) {\n";
|
||||||
$output .= "function {$_template->properties['unifunc']} (\$_smarty_tpl) {\n";
|
$output .= "function {$_template->properties['unifunc']} (\$_smarty_tpl) {\n";
|
||||||
|
@@ -325,9 +325,6 @@ abstract class Smarty_Internal_TemplateCompilerBase
|
|||||||
if ((isset($this->smarty->autoload_filters['post']) || isset($this->smarty->registered_filters['post'])) && !$this->suppressFilter && $_compiled_code != '') {
|
if ((isset($this->smarty->autoload_filters['post']) || isset($this->smarty->registered_filters['post'])) && !$this->suppressFilter && $_compiled_code != '') {
|
||||||
$_compiled_code = Smarty_Internal_Filter_Handler::runFilter('post', $_compiled_code, $template);
|
$_compiled_code = Smarty_Internal_Filter_Handler::runFilter('post', $_compiled_code, $template);
|
||||||
}
|
}
|
||||||
if (!empty($this->templateProperties)) {
|
|
||||||
$this->template->properties['tpl_function'] = $this->templateProperties['tpl_function'];
|
|
||||||
}
|
|
||||||
if ($this->suppressTemplatePropertyHeader) {
|
if ($this->suppressTemplatePropertyHeader) {
|
||||||
$_compiled_code .= $merged_code;
|
$_compiled_code .= $merged_code;
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user