Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- improvement replaced some calls of preg_replace with str_replace (I…

…ssue 73)

git-svn-id: http://smarty-php.googlecode.com/svn/trunk@4552 9dce5a81-9a42-0410-99e4-3799d3902e7f
  • Loading branch information...
commit 56691f2bf18cf722dd3bf85ac81c5f37c169bb0c 1 parent d58f862
uwe.tews@googlemail.com authored
View
1  distribution/change_log.txt
@@ -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
View
2  distribution/libs/sysplugins/smarty_internal_compile_include.php
@@ -155,7 +155,7 @@ public function compile($args, $compiler, $parameter)
$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;
View
2  distribution/libs/sysplugins/smarty_internal_templatebase.php
@@ -264,7 +264,7 @@ public function fetch($template = null, $cache_id = null, $compile_id = null, $p
// 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;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.