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

bug with "%>"

 
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
f0ma
Smarty n00b


Joined: 21 Dec 2014
Posts: 3

PostPosted: Sun Dec 21, 2014 9:44 am    Post subject: bug with "%>" Reply with quote

smarty 3.1.21 replace "%>" with "st". is it bug or feature??
all works fine in 3.1.20
i looked in compiled template (3.1.20) - if in template i have "<%" or "%>" in compiled version it looks like "<<?php ?>%" and "%<?php ?>>"
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Sun Dec 21, 2014 4:47 pm    Post subject: Reply with quote

STC?
Back to top
View user's profile Send private message
f0ma
Smarty n00b


Joined: 21 Dec 2014
Posts: 3

PostPosted: Mon Dec 22, 2014 7:18 pm    Post subject: Reply with quote

AnrDaemon wrote:
STC?

as i wrote - try make template with this content: <% %>
it will be enough to see the problem. in compiled file will be "st" instead of "%>" and "<?php echo '<%'; ?>" instead of "<%"
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Tue Dec 23, 2014 7:53 pm    Post subject: Reply with quote

<% and %> are PHP ASP tags. They treated by Smarty depending on the $php_handling setting. The default PHP_PASSTHRU does echo them.
Back to top
View user's profile Send private message
f0ma
Smarty n00b


Joined: 21 Dec 2014
Posts: 3

PostPosted: Fri Dec 26, 2014 8:21 am    Post subject: Reply with quote

U.Tews wrote:
<% and %> are PHP ASP tags. They treated by Smarty depending on the $php_handling setting. The default PHP_PASSTHRU does echo them.


Ok. Lets try it again.
I need that <% and %> pass throuht smarty as it is! i need them in javascript (for underscorejs template).
Smarty must not change them!
In smarty 3.20 all works fine.
In smarty 3.21 with SAME SETTING it doesn't work.
in result i get "st" instead of "%>".
tried change $smarty->php_handling to:
Smarty::PHP_QUOTE - "<%" - replaced with "&lt;%", "%>" - disapered
Smarty::PHP_PASSTHRU - "<%" - ok, "%>" - replaced with "st"
Smarty::PHP_REMOVE - "<%" and "%>" are removed
Smarty::PHP_ALLOW - gives error: Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "%>" PHP in template not allowed. Use SmartyBC to enable it
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sat Dec 27, 2014 12:21 am    Post subject: Reply with quote

Yes, you are right. This bug sneaked in in 3.1.21

You could download the current status of the upcomming version 3.1.22 from https://github.com/smarty-php/smarty
Back to top
View user's profile Send private message
Laul0
Smarty n00b


Joined: 24 Oct 2015
Posts: 1

PostPosted: Sat Oct 24, 2015 3:09 pm    Post subject: ASP Delimiters Reply with quote

With the new version of Smart (3.1.27) the ASP delimiters '<%' and '%>' don't work :/
Any people have the same issue?
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sat Oct 24, 2015 9:17 pm    Post subject: Reply with quote

See https://github.com/smarty-php/smarty/issues/101

Please post problems only at one place
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