You've already forked postfixadmin
mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2025-08-07 17:42:53 +03:00
update Smarty to v3.1.33 - "This release does cover security issue CVE-2018-16831, other bug fixes (see changelog.txt) and adds a new feature of the {capture} tag (see NEW_FEATURES.txt)."
This commit is contained in:
@@ -25,9 +25,13 @@ class Smarty_Internal_Runtime_CodeFrame
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function create(Smarty_Internal_Template $_template, $content = '', $functions = '', $cache = false,
|
||||
Smarty_Internal_TemplateCompilerBase $compiler = null)
|
||||
{
|
||||
public function create(
|
||||
Smarty_Internal_Template $_template,
|
||||
$content = '',
|
||||
$functions = '',
|
||||
$cache = false,
|
||||
Smarty_Internal_TemplateCompilerBase $compiler = null
|
||||
) {
|
||||
// build property code
|
||||
$properties[ 'version' ] = Smarty::SMARTY_VERSION;
|
||||
$properties[ 'unifunc' ] = 'content_' . str_replace(array('.', ','), '_', uniqid('', true));
|
||||
@@ -35,14 +39,14 @@ class Smarty_Internal_Runtime_CodeFrame
|
||||
$properties[ 'has_nocache_code' ] = $_template->compiled->has_nocache_code;
|
||||
$properties[ 'file_dependency' ] = $_template->compiled->file_dependency;
|
||||
$properties[ 'includes' ] = $_template->compiled->includes;
|
||||
} else {
|
||||
} else {
|
||||
$properties[ 'has_nocache_code' ] = $_template->cached->has_nocache_code;
|
||||
$properties[ 'file_dependency' ] = $_template->cached->file_dependency;
|
||||
$properties[ 'cache_lifetime' ] = $_template->cache_lifetime;
|
||||
}
|
||||
$output = "<?php\n";
|
||||
$output .= "/* Smarty version {$properties[ 'version' ]}, created on " . strftime("%Y-%m-%d %H:%M:%S") .
|
||||
"\n from '" . str_replace('*/','* /',$_template->source->filepath) . "' */\n\n";
|
||||
"\n from '" . str_replace('*/', '* /', $_template->source->filepath) . "' */\n\n";
|
||||
$output .= "/* @var Smarty_Internal_Template \$_smarty_tpl */\n";
|
||||
$dec = "\$_smarty_tpl->_decodeProperties(\$_smarty_tpl, " . var_export($properties, true) . ',' .
|
||||
($cache ? 'true' : 'false') . ')';
|
||||
@@ -56,11 +60,6 @@ class Smarty_Internal_Runtime_CodeFrame
|
||||
if ($cache && isset($_template->smarty->ext->_tplFunction)) {
|
||||
$output .= "\$_smarty_tpl->smarty->ext->_tplFunction->registerTplFunctions(\$_smarty_tpl, " .
|
||||
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;
|
||||
@@ -69,11 +68,15 @@ class Smarty_Internal_Runtime_CodeFrame
|
||||
$output .= "<?php }\n";
|
||||
// remove unneeded PHP tags
|
||||
if (preg_match('/\s*\?>[\n]?<\?php\s*/', $output)) {
|
||||
$curr_split = preg_split('/\s*\?>[\n]?<\?php\s*/',
|
||||
$output);
|
||||
preg_match_all('/\s*\?>[\n]?<\?php\s*/',
|
||||
$output,
|
||||
$curr_parts);
|
||||
$curr_split = preg_split(
|
||||
'/\s*\?>[\n]?<\?php\s*/',
|
||||
$output
|
||||
);
|
||||
preg_match_all(
|
||||
'/\s*\?>[\n]?<\?php\s*/',
|
||||
$output,
|
||||
$curr_parts
|
||||
);
|
||||
$output = '';
|
||||
foreach ($curr_split as $idx => $curr_output) {
|
||||
$output .= $curr_output;
|
||||
@@ -83,8 +86,10 @@ class Smarty_Internal_Runtime_CodeFrame
|
||||
}
|
||||
}
|
||||
if (preg_match('/\?>\s*$/', $output)) {
|
||||
$curr_split = preg_split('/\?>\s*$/',
|
||||
$output);
|
||||
$curr_split = preg_split(
|
||||
'/\?>\s*$/',
|
||||
$output
|
||||
);
|
||||
$output = '';
|
||||
foreach ($curr_split as $idx => $curr_output) {
|
||||
$output .= $curr_output;
|
||||
@@ -92,4 +97,4 @@ class Smarty_Internal_Runtime_CodeFrame
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user