From 9736393913ed2e7b2b8c9d76fd96a86ea7dde9f0 Mon Sep 17 00:00:00 2001 From: mohrt Date: Thu, 17 Apr 2003 15:43:31 +0000 Subject: [PATCH] fix bug in new comment logic --- libs/Smarty_Compiler.class.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index 7531d643..63f1a1f0 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -240,12 +240,14 @@ class Smarty_Compiler extends Smarty { /* Annihilate the comments. */ $_comment_search = array( - "!(\r|\r\n|\n)({$ldq})\*(.*?)\*({$rdq})(\r|\r\n|\n)!s", - "!({$ldq})\*(.*?)\*({$rdq})!s"); + "!{$ldq}\*.*?\*{$rdq}!s", // get all onto one line + "!(\r|\r\n|\n)%%%SMARTY_COMMENT%%%(\r|\r\n|\n)!", // remove CR if on one line + '!%%%SMARTY_COMMENT%%%!'); // remove remaining comments $_comment_replace = array( + '%%%SMARTY_COMMENT%%%', '\\1', - ''); - + ''); + $template_source = preg_replace($_comment_search, $_comment_replace, $template_source);