|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
heal Smarty Rookie
Joined: 11 Mar 2013 Posts: 7
|
Posted: Mon Mar 11, 2013 2:48 pm Post subject: weird bug with empty line. |
|
|
Sorry for that stupid subject..
I have found something weird. This is my not working template (3.1.13)
Code: |
{include 'header.tpl' delay=5 redir="connect4.php?wid=$wid&xf=$xf&game_id=$game_id"}
<div>
some text..
</div>
|
This throws me an error:
Code: | Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/data/www/site/_xhtml3/connect4.tpl" on line 86 "{include 'header.tpl' delay=5 redir="connect4.php?wid=$wid&xf=$xf&game_id=$game_id"}" - Unexpected "5", expected one of: "identifier"' in |
BUT if I add an empty line after {include ..} , it works.
Code: |
{include 'header.tpl' delay=5 redir="connect4.php?wid=$wid&xf=$xf&game_id=$game_id"}
<div>
some text...
</div>
|
it took me hours to figure this out, but i can't understand this, because in the same tpl file I have other includes, and they works without an empty line.
Please explain me, what is wrong with my code. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Mar 12, 2013 1:54 pm Post subject: |
|
|
Are you using the latest Smarty 3? also did you try adding "file=":
Code: | {include file='header.tpl' delay=5 redir="connect4.php?wid=$wid&xf=$xf&game_id=$game_id"} |
It might be a bug, or it might have been fixed if you are not using the latest. |
|
Back to top |
|
heal Smarty Rookie
Joined: 11 Mar 2013 Posts: 7
|
Posted: Tue Mar 12, 2013 4:07 pm Post subject: |
|
|
Yes, I'm using the latest Smarty. I've checked this out with v. 3.1.12. I get the same error.
I have checked it with and without 'file=' |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Mar 12, 2013 4:47 pm Post subject: |
|
|
ok how about putting the 5 in quotes? (just trying to find a possible bug workaround) |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Mar 12, 2013 4:48 pm Post subject: |
|
|
Again I can't reproduce your problem. It does look like some invisable characters which go away if you edit the template. |
|
Back to top |
|
heal Smarty Rookie
Joined: 11 Mar 2013 Posts: 7
|
Posted: Tue Mar 12, 2013 5:36 pm Post subject: |
|
|
No, there aren't invisible characters in those lines.
I'm using VIM, checked the hidden characters with :set invlist
Screenshot: image2
I'we checked with quotes, doesn't helped. |
|
Back to top |
|
heal Smarty Rookie
Joined: 11 Mar 2013 Posts: 7
|
Posted: Tue Mar 12, 2013 10:19 pm Post subject: |
|
|
Based on this post, http://www.smarty.net/forums/viewtopic.php?p=77417#77414 I found the reason, why my production server throws an error and a test server not.
I have mbstring.func_overload=7 in the production server, and 0 on test.
This causes the error.
Thank you for all, U.Tews and mohrt! |
|
Back to top |
|
|
|
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
|