From 1f838f15e7380bec9c6ddb6061f8912fc389e766 Mon Sep 17 00:00:00 2001 From: messju Date: Tue, 29 Nov 2005 12:22:54 +0000 Subject: [PATCH] fixed code generation of non-cacheable blocks to play well with php's "Alternative syntax" used for example in compiled {if}..{else}..{/if} blocks. (see: http://php.net/manual/en/control-structures.alternative-syntax.php on "Alternative syntax") thanks to kihara from the forum. --- NEWS | 2 ++ libs/Smarty_Compiler.class.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 5d3cf392..29a9f21a 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ + - fixed code generation of non-cacheable blocks to play well with php's + "Alternative syntax for control structures" (kihara, messju) - fix handling of multiple identical inserts in one display()-call (messju) - replace {} string access with equivalent substr() to avoid E_STRICT warnings in PHP 5.1 (boots) diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index 25d03b28..9dc6f277 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -2216,7 +2216,7 @@ class Smarty_Compiler extends Smarty { if (!isset($this->_cache_serial)) $this->_cache_serial = md5(uniqid('Smarty')); $_ret = 'if ($this->caching && !$this->_cache_including) { echo \'{nocache:' . $this->_cache_serial . '#' . $this->_nocache_count - . '}\';}'; + . '}\'; };'; return $_ret; } @@ -2233,7 +2233,7 @@ class Smarty_Compiler extends Smarty { || --$this->_cacheable_state>0) return ''; return 'if ($this->caching && !$this->_cache_including) { echo \'{/nocache:' . $this->_cache_serial . '#' . ($this->_nocache_count++) - . '}\';}'; + . '}\'; };'; }