View previous topic :: View next topic |
Author |
Message |
f0ma Smarty n00b
Joined: 21 Dec 2014 Posts: 3
|
Posted: Sun Dec 21, 2014 9:44 am Post subject: bug with "%>" |
|
|
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 |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Sun Dec 21, 2014 4:47 pm Post subject: |
|
|
STC? |
|
Back to top |
|
f0ma Smarty n00b
Joined: 21 Dec 2014 Posts: 3
|
Posted: Mon Dec 22, 2014 7:18 pm Post subject: |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Dec 23, 2014 7:53 pm Post subject: |
|
|
<% 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 |
|
f0ma Smarty n00b
Joined: 21 Dec 2014 Posts: 3
|
Posted: Fri Dec 26, 2014 8:21 am Post subject: |
|
|
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 "<%", "%>" - 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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sat Dec 27, 2014 12:21 am Post subject: |
|
|
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 |
|
Laul0 Smarty n00b
Joined: 24 Oct 2015 Posts: 1
|
Posted: Sat Oct 24, 2015 3:09 pm Post subject: ASP Delimiters |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
|
Back to top |
|
|