- update code generated by template function call handler

This commit is contained in:
uwetews
2015-10-18 22:12:16 +02:00
parent 0e28150b4a
commit 4e1d6707fe
3 changed files with 7 additions and 4 deletions
@@ -53,10 +53,12 @@ class Smarty_Internal_Function_Call_Handler
$content = $cache->read($tplPtr);
if ($content) {
// check if we must update file dependency
if (!preg_match("/'{$funcParam['uid']}'([\S\s]*?)'nocache_hash'/", $content, $match2)) {
$content = preg_replace("/('file_dependency'([\S\s]*?)\()/", "\\1{$match1[0]}", $content);
if (!preg_match("/'{$funcParam['uid']}'(.*?)'nocache_hash'/", $content, $match2)) {
$content = preg_replace("/('file_dependency'(.*?)\()/", "\\1{$match1[0]}", $content);
}
$cache->write($tplPtr, $content . "<?php " . $match[0] . "?>\n");
$cache->write($tplPtr, preg_replace('/\s*\?>\s*$/', "\n", $content) . "\n" .
preg_replace(array('/^\s*<\?php\s+/', '/\s*\?>\s*$/'), "\n",
$match[0]));
}
}
return true;