diff --git a/Smarty.class.php b/Smarty.class.php index a3274056..2dd6ef8f 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -517,15 +517,17 @@ class Smarty /* loop through text blocks */ for($curr_tb = 0; $curr_tb <= count($text_blocks); $curr_tb++) { /* match anything within */ - if(preg_match_all('!(<\?[^?]*?\?>)!i',$text_blocks[$curr_tb],$sp_match)) { + if(preg_match_all('!(<\?[^?]*?\?>|)!i',$text_blocks[$curr_tb],$sp_match)) { /* found at least one match, loop through each one */ foreach($sp_match[0] as $curr_sp) { - if(!$this->allow_php) + if(!$this->allow_php) { /* we don't allow php, so echo anything in */ - $text_blocks[$curr_tb] = str_replace($curr_sp,'',$text_blocks[$curr_tb]); - elseif(!preg_match("!^<\?(php | )!i",$curr_sp)) + $text_blocks[$curr_tb] = str_replace($curr_sp,'',$text_blocks[$curr_tb]); + /* echo