Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

ForEach unrecognized Syntax Error on double brackets {{}}

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
matija@nivas.hr
Smarty n00b


Joined: 09 Jan 2019
Posts: 2

PostPosted: Wed Jan 09, 2019 3:32 pm    Post subject: ForEach unrecognized Syntax Error on double brackets {{}} Reply with quote

I have "{" and "}" characters set as my delimiters. I made a syntax error and closed my foreach loop with double brackets.
Code:

{ foreach $var as $vars }
   {* code here *}
{{ /foreach }}  // <---- SYNTAX ERROR

Not only did Smarty not warn me of the error but it parsed the code and executed. Needless to say this was hard to diagnose because the error spilled out into multiple templates and even my normal php scripts and that was due to the foreach loop using output buffer layers for each iteration that when unproperly closed and not handled by smarty as error get carried over to general scripts.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Thu Jan 10, 2019 1:49 pm    Post subject: Reply with quote

Reproduced on 3.1.33.
Can you please hook a bug report at https://github.com/smarty-php/smarty/issues
Back to top
View user's profile Send private message
matija@nivas.hr
Smarty n00b


Joined: 09 Jan 2019
Posts: 2

PostPosted: Tue Jan 15, 2019 11:47 am    Post subject: Done Reply with quote

I have reported the issue. Thanks for quick response.
https://github.com/smarty-php/smarty/issues/530
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP