Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Elegant bug

 
Post new topic   Reply to topic    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
liviu.gelea
Smarty Rookie


Joined: 25 Nov 2015
Posts: 16

PostPosted: Thu Dec 17, 2015 5:34 pm    Post subject: Elegant bug Reply with quote

This fails:
Code:

a{if 0}1{else}0{/if}a

expected: "a0a"
output: "aa"


This works:
Code:

a{if 0}1{else} 0{/if}a

expected: "a 0a"
output: "a 0a" (awesome)

There is no complicated logic inside the script that displays this. No filters, no functions, no cache, nothing. Just...

Code:

require_once( "../../vendor/Smarty/Smarty.class.php");
$smarty = new Smarty;
$smarty->display( '......................\htdocs\templates\test.inc.php' );
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1404

PostPosted: Thu Dec 17, 2015 6:35 pm    Post subject: Reply with quote

Smarty and PHP versions - ?
Back to top
View user's profile Send private message
liviu.gelea
Smarty Rookie


Joined: 25 Nov 2015
Posts: 16

PostPosted: Thu Dec 17, 2015 6:36 pm    Post subject: Reply with quote

const SMARTY_VERSION = '3.1.29-dev/3';
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Thu Dec 17, 2015 8:50 pm    Post subject: Reply with quote

The fix is now on github in the master branch.
It will be soon included in the maintenance release 3.1.29
Back to top
View user's profile Send private message
liviu.gelea
Smarty Rookie


Joined: 25 Nov 2015
Posts: 16

PostPosted: Fri Dec 18, 2015 1:00 pm    Post subject: Thanks Reply with quote

Thanks a lot
Back to top
View user's profile Send private message
ildar
Smarty Rookie


Joined: 14 May 2015
Posts: 14

PostPosted: Wed Apr 06, 2016 6:31 am    Post subject: Reply with quote

U.Tews wrote:
The fix is now on github in the master branch.
It will be soon included in the maintenance release 3.1.29



Please, have a look
https://github.com/smarty-php/smarty/commit/9a8bcb93b1c7a4df574fc787fd4687e5d388ffc6#diff-87bb4710afb60e1131f716831b30cd7aL719

Thank you.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    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