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 report: (seems a bug) configure file need a blank line

 
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 -> Smarty 3
View previous topic :: View next topic  
Author Message
yarco
Smarty Regular


Joined: 20 Mar 2009
Posts: 39

PostPosted: Fri Mar 20, 2009 3:06 pm    Post subject: bug report: (seems a bug) configure file need a blank line Reply with quote

smarty configure file

error output:
Code:

Code: 0
Error: Syntax Error in config file "/home/yarco/Public/workspace/code/coto/root/lang/index.conf" on line 69 "NoBody = "-- � --"" - Unexpected ""-- � --"", expected one of: EOL
File: /home/yarco/Public/workspace/code/coto/coto/entry/smarty3/sysplugins/internal.config_file_compiler.php
Line: 109


resolve:
Code:

NoTime = "-- 无 --"
NoBody = "-- 无 --" ; < if the file end here, it will show the above error

^ that is a blank line


but it works fine in previous version in smarty.
Back to top
View user's profile Send private message
yarco
Smarty Regular


Joined: 20 Mar 2009
Posts: 39

PostPosted: Fri Mar 20, 2009 3:11 pm    Post subject: Reply with quote

it is not a big problem i think.
it seems some parser need a new line(sometimes happened in c language)...but still feeling unhappy.
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Fri Mar 20, 2009 3:43 pm    Post subject: Reply with quote

Yes, the parser expects that every line is terminated by newline.
Back to top
View user's profile Send private message
SLX
Smarty Rookie


Joined: 19 Nov 2009
Posts: 11
Location: Wroclaw, Poland

PostPosted: Thu Nov 19, 2009 3:50 pm    Post subject: Reply with quote

It also affect situation where config file is empty. Then the smarty compiler go to infinite loop between
Code:
Smarty_Internal_Config->getCompiledConfig( )
Smarty_Internal_Config->compileConfigSource( )

and PHP produce error:
Quote:
Fatal error: Maximum function nesting level of '100' reached, aborting! in ***/sysplugins/smarty_internal_config.php on line 44


Needs of new line in config files is some irritating, but I find nice solution. Changing one line in file /sysplugins/smarty_internal_config_file_compiler.php : 44

Code:
From:
$_content = $config->getConfigSource();

to:
$_content = $config->getConfigSource()."\n";



Or in file /sysplugins/smarty_internal_config.php : 115

Code:
$this->config_source = file_get_contents($this->getConfigFilepath())."\n";


Applies version 3.0b4 (3351)
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Fri Nov 20, 2009 9:53 pm    Post subject: Reply with quote

This is fixed in the SVN now.
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 -> Smarty 3 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