|
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 |
SunWuKung Smarty Rookie
Joined: 20 Sep 2008 Posts: 25
|
Posted: Tue Dec 14, 2010 8:59 am Post subject: Unexpected input at line xx |
|
|
Hi,
while switching to Smart3 I came across something I think is a bug.
Whenever a line if is very long I get an Unexpected input at line xx error and the file is not compiled even if it contains no Smarty tag.
The same files used to compile fine in Smarty 2.
I frequently work with xml files in which long, unformatted lines (15k+ characters) are common, so this is a problem for me. Enclosing the offending line in {literal} tags helps, but it seems like a bad practice having to modifiy all existing xml templates and search for too long lines.
Wouldn't it be possible for the compiler to first check the line if it contains Smarty tag at all and if it doesn't skip the parsing process that throws this error?
Could somebody suggest a solution?
Thx.
SWK |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Dec 14, 2010 12:56 pm Post subject: |
|
|
This is a problem when you have very long lines and pcre.backtrack_limit in php.ini has a too low value.
Set it to a (much) higher value or disable it by
Code: | ini_set('pcre.backtrack_limit', -1); |
|
|
Back to top |
|
satas Smarty Rookie
Joined: 10 Mar 2010 Posts: 6 Location: Saint-Petersburg, Russia
|
Posted: Mon Jan 31, 2011 1:39 pm Post subject: |
|
|
U.Tews wrote: | This is a problem when you have very long lines and pcre.backtrack_limit in php.ini has a too low value.
Set it to a (much) higher value or disable it by
Code: | ini_set('pcre.backtrack_limit', -1); |
|
Hi I have the same problem.
File smarty3 trying to parse contains special char VT (vertical tab). That template contains only few words (not very long lines as in example above).
Thx in advance. |
|
Back to top |
|
satas Smarty Rookie
Joined: 10 Mar 2010 Posts: 6 Location: Saint-Petersburg, Russia
|
Posted: Mon Jan 31, 2011 1:43 pm Post subject: |
|
|
Dont know whether that symbol would be saved but i'll try to post it
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Mon Jan 31, 2011 2:19 pm Post subject: |
|
|
Indeed the lexer/parser did fail on some special chars like VT.
The fix is in the SVN trunk now. |
|
Back to top |
|
satas Smarty Rookie
Joined: 10 Mar 2010 Posts: 6 Location: Saint-Petersburg, Russia
|
Posted: Mon Jan 31, 2011 2:56 pm Post subject: |
|
|
Many thanx for fast fix, everything works fine now! |
|
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
|