- bugfix preg_replace could fail on large content resulting in a blank page https://github.com/smarty-php/smarty/issues/417

This commit is contained in:
Uwe Tews
2018-03-23 19:34:18 +01:00
parent 3a3b8c75a1
commit c81948d602

View File

@@ -72,6 +72,7 @@ class Smarty_Internal_Runtime_UpdateCache
$php_pattern = '/(<%|%>|<\?php|<\?|\?>|<script\s+language\s*=\s*[\"\']?\s*php\s*[\"\']?\s*>)/'; $php_pattern = '/(<%|%>|<\?php|<\?|\?>|<script\s+language\s*=\s*[\"\']?\s*php\s*[\"\']?\s*>)/';
$content = ob_get_clean(); $content = ob_get_clean();
$hash_array = $cached->hashes; $hash_array = $cached->hashes;
$hash_array[$_template->compiled->nocache_hash] = true;
$hash_array = array_keys($hash_array); $hash_array = array_keys($hash_array);
$nocache_hash = '(' . implode('|', $hash_array) . ')'; $nocache_hash = '(' . implode('|', $hash_array) . ')';
$_template->cached->has_nocache_code = false; $_template->cached->has_nocache_code = false;