mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
- improvement replaced some calls of preg_replace with str_replace (Issue 73)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
- improvement stream_resolve_include_path() added to Smarty_Internal_Get_Include_Path (Forum Topic 20980)
|
||||
- bugfix fetch('extends:foo.tpl') always yielded $source->exists == true (Forum Topic 20980)
|
||||
- added modifier unescape:"url", fix (Forum Topic 20980)
|
||||
- improvement replaced some calls of preg_replace with str_replace (Issue 73)
|
||||
|
||||
30.01.2012
|
||||
- bugfix Smarty_Security internal $_resource_dir cache wasn't properly propagated
|
||||
|
@@ -155,7 +155,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase {
|
||||
$compiled_code = preg_replace("/(<\?php \/\*%%SmartyHeaderCode:{$tpl->properties['nocache_hash']}%%\*\/(.+?)\/\*\/%%SmartyHeaderCode%%\*\/\?>\n)/s", '', $compiled_code);
|
||||
if ($tpl->has_nocache_code) {
|
||||
// replace nocache_hash
|
||||
$compiled_code = preg_replace("/{$tpl->properties['nocache_hash']}/", $compiler->template->properties['nocache_hash'], $compiled_code);
|
||||
$compiled_code = str_replace("{$tpl->properties['nocache_hash']}", $compiler->template->properties['nocache_hash'], $compiled_code);
|
||||
$compiler->template->has_nocache_code = true;
|
||||
}
|
||||
$compiler->merged_templates[$tpl->properties['unifunc']] = $compiled_code;
|
||||
|
@@ -264,7 +264,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
|
||||
// var_dump('renderTemplate', $_template->has_nocache_code, $_template->template_resource, $_template->properties['nocache_hash'], $_template->parent->properties['nocache_hash'], $_output);
|
||||
if (!empty($_template->properties['nocache_hash']) && !empty($_template->parent->properties['nocache_hash'])) {
|
||||
// replace nocache_hash
|
||||
$_output = preg_replace("/{$_template->properties['nocache_hash']}/", $_template->parent->properties['nocache_hash'], $_output);
|
||||
$_output = str_replace("{$_template->properties['nocache_hash']}", $_template->parent->properties['nocache_hash'], $_output);
|
||||
$_template->parent->has_nocache_code = $_template->parent->has_nocache_code || $_template->has_nocache_code;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user