cvs: smarty /libs Smarty_Compiler.class.php
| From: | Monte Ohrt | Date: | Thu, 17 Apr 2003 15:43:31 +0000 |
| Subject: | cvs: smarty /libs Smarty_Compiler.class.php | ||
| Groups: | php.smarty.cvs | ||
| Request: | Send a blank email to php-smarty-cvs+get-530@lists.php.net to get a copy of this message | ||
mohrt Thu Apr 17 11:43:31 2003 EDT
Modified files:
/smarty/libs Smarty_Compiler.class.php
Log:
fix bug in new comment logic
Index: smarty/libs/Smarty_Compiler.class.php
diff -u smarty/libs/Smarty_Compiler.class.php:1.208 smarty/libs/Smarty_Compiler.class.php:1.209
--- smarty/libs/Smarty_Compiler.class.php:1.208 Thu Apr 17 11:20:19 2003
+++ smarty/libs/Smarty_Compiler.class.php Thu Apr 17 11:43:31 2003
@@ -39,7 +39,7 @@
* @package Smarty
*/
-/* $Id: Smarty_Compiler.class.php,v 1.208 2003/04/17 15:20:19 mohrt Exp $ */
+/* $Id: Smarty_Compiler.class.php,v 1.209 2003/04/17 15:43:31 mohrt Exp $ */
class Smarty_Compiler extends Smarty {
@@ -240,12 +240,14 @@
/* 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);