mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
fix bug in new comment logic
This commit is contained in:
@@ -240,12 +240,14 @@ class Smarty_Compiler extends Smarty {
|
|||||||
/* Annihilate the comments. */
|
/* Annihilate the comments. */
|
||||||
|
|
||||||
$_comment_search = array(
|
$_comment_search = array(
|
||||||
"!(\r|\r\n|\n)({$ldq})\*(.*?)\*({$rdq})(\r|\r\n|\n)!s",
|
"!{$ldq}\*.*?\*{$rdq}!s", // get all onto one line
|
||||||
"!({$ldq})\*(.*?)\*({$rdq})!s");
|
"!(\r|\r\n|\n)%%%SMARTY_COMMENT%%%(\r|\r\n|\n)!", // remove CR if on one line
|
||||||
|
'!%%%SMARTY_COMMENT%%%!'); // remove remaining comments
|
||||||
$_comment_replace = array(
|
$_comment_replace = array(
|
||||||
|
'%%%SMARTY_COMMENT%%%',
|
||||||
'\\1',
|
'\\1',
|
||||||
'');
|
'');
|
||||||
|
|
||||||
$template_source = preg_replace($_comment_search,
|
$template_source = preg_replace($_comment_search,
|
||||||
$_comment_replace,
|
$_comment_replace,
|
||||||
$template_source);
|
$template_source);
|
||||||
|
Reference in New Issue
Block a user