mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-09 21:04:28 +02:00
fixed detection of non-cached block when writing compiled includes
This commit is contained in:
@@ -15,12 +15,12 @@
|
|||||||
|
|
||||||
function smarty_core_write_compiled_include($params, &$smarty)
|
function smarty_core_write_compiled_include($params, &$smarty)
|
||||||
{
|
{
|
||||||
$_tag_start = 'if \(\$this->caching && \!\$this->_cache_including\) \{ echo \'\{nocache\:('.$params['cache_serial'].')#(\d+)\}\'; \};';
|
$_tag_start = 'if \(\$this->caching && \!\$this->_cache_including\)\: echo \'\{nocache\:('.$params['cache_serial'].')#(\d+)\}\'; endif;';
|
||||||
$_tag_end = 'if \(\$this->caching && \!\$this->_cache_including\) \{ echo \'\{/nocache\:(\\2)#(\\3)\}\'; \};';
|
$_tag_end = 'if \(\$this->caching && \!\$this->_cache_including\)\: echo \'\{/nocache\:(\\2)#(\\3)\}\'; endif;';
|
||||||
|
|
||||||
preg_match_all('!('.$_tag_start.'(.*)'.$_tag_end.')!Us',
|
preg_match_all('!('.$_tag_start.'(.*)'.$_tag_end.')!Us',
|
||||||
$params['compiled_content'], $_match_source, PREG_SET_ORDER);
|
$params['compiled_content'], $_match_source, PREG_SET_ORDER);
|
||||||
|
|
||||||
// no nocache-parts found: done
|
// no nocache-parts found: done
|
||||||
if (count($_match_source)==0) return;
|
if (count($_match_source)==0) return;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user